Make MailboxManager#checkConnection() blocking and let the UI manage the executor

This commit is contained in:
Torsten Grote
2022-04-07 10:28:11 -03:00
parent 5b648cbd35
commit 60a1a4d2d1
3 changed files with 27 additions and 35 deletions

View File

@@ -1,9 +1,7 @@
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;
@@ -36,13 +34,11 @@ public interface MailboxManager {
/**
* 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}.
*
* @return true (success) or false (error).
* A {@link OwnMailboxConnectionStatusEvent} might be broadcast with a new
* {@link MailboxStatus}.
*/
void checkConnection(Consumer<Boolean> connectionCallback);
boolean checkConnection();
}