Add checkConnection() to MailboxManager

This commit is contained in:
Torsten Grote
2022-04-01 12:46:33 -03:00
parent 44f9f0bbc5
commit 5e7891d78a
2 changed files with 62 additions and 1 deletions

View File

@@ -1,7 +1,9 @@
package org.briarproject.bramble.api.mailbox;
import org.briarproject.bramble.api.Consumer;
import org.briarproject.bramble.api.db.DbException;
import org.briarproject.bramble.api.db.Transaction;
import org.briarproject.bramble.api.lifecycle.IoExecutor;
import javax.annotation.Nullable;
@@ -32,4 +34,15 @@ public interface MailboxManager {
*/
MailboxPairingTask startPairingTask(String qrCodePayload);
/**
* Can be used by the UI to test the mailbox connection.
* After the connection has been made, the given {@param connectionCallback}
* will be called with true (success) or false (error).
* In addition, a {@link OwnMailboxConnectionStatusEvent} might be broadcast
* with a new {@link MailboxStatus}.
* <p>
* Note that the callback will be made on the {@link IoExecutor}.
*/
void checkConnection(Consumer<Boolean> connectionCallback);
}