@@ -67,6 +67,10 @@ public Connection() {
67
67
scheduler = Executors .newSingleThreadScheduledExecutor ();
68
68
}
69
69
70
+ /**
71
+ * The MessagePublisher listens on the connection to the KeePassXC database and adds messages
72
+ * received to a queue.
73
+ */
70
74
class MessagePublisher implements Runnable {
71
75
private boolean doStop = false ;
72
76
private int errorCount = 0 ;
@@ -109,6 +113,14 @@ class MessageConsumer implements Callable<JSONObject> {
109
113
private final String action ;
110
114
private final byte [] nonce ;
111
115
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
+ */
112
124
public MessageConsumer (String action , byte [] nonce ) {
113
125
this .action = action ;
114
126
this .nonce = nonce ;
@@ -720,8 +732,18 @@ public void setCredentials(Optional<Credentials> credentials) {
720
732
721
733
protected abstract boolean isConnected ();
722
734
735
+ /**
736
+ * Closes the socket or named pipe respectively.
737
+ *
738
+ * @throws IOException If an I/O error occurred.
739
+ */
723
740
public abstract void terminateConnection () throws IOException ;
724
741
742
+ /**
743
+ * Closes the socket or named pipe respectively and shuts down the application.
744
+ *
745
+ * @throws Exception Something went wrong.
746
+ */
725
747
@ Override
726
748
public abstract void close () throws Exception ;
727
749
}
0 commit comments