mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 11:19:04 +01:00
Use the event bus to observe contacts connecting and disconnecting.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when a contact connects that was not previously
|
||||
* connected via any transport.
|
||||
*/
|
||||
public class ContactConnectedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
public ContactConnectedEvent(ContactId contactId) {
|
||||
this.contactId = contactId;
|
||||
}
|
||||
|
||||
public ContactId getContactId() {
|
||||
return contactId;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
package org.briarproject.api.event;
|
||||
|
||||
import org.briarproject.api.ContactId;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when a contact disconnects and is no longer
|
||||
* connected via any transport.
|
||||
*/
|
||||
public class ContactDisconnectedEvent extends Event {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
public ContactDisconnectedEvent(ContactId contactId) {
|
||||
this.contactId = contactId;
|
||||
}
|
||||
|
||||
public ContactId getContactId() {
|
||||
return contactId;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user