mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 18:59:06 +01:00
Added ConnectionListener interface for contact list and supporting code.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
package net.sf.briar.api.transport;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/** An interface for listening for connection and disconnection events. */
|
||||
public interface ConnectionListener {
|
||||
|
||||
/** Called when a contact connects and has no existing connections. */
|
||||
void contactConnected(ContactId c);
|
||||
|
||||
/** Called when a contact disconnects and has no remaining connections. */
|
||||
void contactDisconnected(ContactId c);
|
||||
}
|
||||
@@ -10,9 +10,15 @@ import net.sf.briar.api.messaging.TransportId;
|
||||
*/
|
||||
public interface ConnectionRegistry {
|
||||
|
||||
void addListener(ConnectionListener c);
|
||||
|
||||
void removeListener(ConnectionListener c);
|
||||
|
||||
void registerConnection(ContactId c, TransportId t);
|
||||
|
||||
void unregisterConnection(ContactId c, TransportId t);
|
||||
|
||||
Collection<ContactId> getConnectedContacts(TransportId t);
|
||||
|
||||
boolean isConnected(ContactId c);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user