Use the event bus to observe contacts connecting and disconnecting.

This commit is contained in:
akwizgran
2014-10-03 10:04:02 +01:00
parent 8b8df435a5
commit cdb5a12156
8 changed files with 85 additions and 51 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}