Skip to content

Commit 7e4e447

Browse files
committed
Add Javadoc
1 parent ace3d61 commit 7e4e447

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

src/main/java/org/keepassxc/Connection.java

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ public Connection() {
6767
scheduler = Executors.newSingleThreadScheduledExecutor();
6868
}
6969

70+
/**
71+
* The MessagePublisher listens on the connection to the KeePassXC database and adds messages
72+
* received to a queue.
73+
*/
7074
class MessagePublisher implements Runnable {
7175
private boolean doStop = false;
7276
private int errorCount = 0;
@@ -109,6 +113,14 @@ class MessageConsumer implements Callable<JSONObject> {
109113
private final String action;
110114
private final byte[] nonce;
111115

116+
/**
117+
* Check the queue of messages from the KeePassXC database for a message with a given action and nonce,
118+
* which is the answer to a request sent before and return the message.
119+
*
120+
* @param action We are searching for a message with a certain action and
121+
* @param nonce a certain nonce.
122+
* @return The message that was looked up.
123+
*/
112124
public MessageConsumer(String action, byte[] nonce) {
113125
this.action = action;
114126
this.nonce = nonce;
@@ -720,8 +732,18 @@ public void setCredentials(Optional<Credentials> credentials) {
720732

721733
protected abstract boolean isConnected();
722734

735+
/**
736+
* Closes the socket or named pipe respectively.
737+
*
738+
* @throws IOException If an I/O error occurred.
739+
*/
723740
public abstract void terminateConnection() throws IOException;
724741

742+
/**
743+
* Closes the socket or named pipe respectively and shuts down the application.
744+
*
745+
* @throws Exception Something went wrong.
746+
*/
725747
@Override
726748
public abstract void close() throws Exception;
727749
}

0 commit comments

Comments
 (0)