mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 20:29:52 +01:00
Attach the affected contact IDs to subscription update events.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
/** An event that is broadcast when a batch of messages is received. */
|
||||
public class BatchReceivedEvent extends DatabaseEvent {
|
||||
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.sf.briar.api.db.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/** An event that is broadcast when a contact is added. */
|
||||
public class ContactAddedEvent extends DatabaseEvent {
|
||||
|
||||
private final ContactId contactId;
|
||||
|
||||
@@ -2,6 +2,7 @@ package net.sf.briar.api.db.event;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/** An event that is broadcast when a contact is removed. */
|
||||
public class ContactRemovedEvent extends ContactAddedEvent {
|
||||
|
||||
public ContactRemovedEvent(ContactId contactId) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
/** An abstract superclass for database events. */
|
||||
public abstract class DatabaseEvent {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
|
||||
/** An interface for receiving notifications when database events occur. */
|
||||
public interface DatabaseListener {
|
||||
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when one or more messages are added to the
|
||||
* database.
|
||||
*/
|
||||
public class MessagesAddedEvent extends DatabaseEvent {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,18 +1,27 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
import net.sf.briar.api.ContactId;
|
||||
|
||||
/**
|
||||
* An event that is broadcast when the set of subscriptions visible to one or
|
||||
* more contacts is updated.
|
||||
*/
|
||||
public class SubscriptionsUpdatedEvent extends DatabaseEvent {
|
||||
|
||||
private final Collection<ContactId> affectedContacts;
|
||||
|
||||
// FIXME: Replace this constructor
|
||||
public SubscriptionsUpdatedEvent() {
|
||||
affectedContacts = null;
|
||||
affectedContacts = Collections.emptyList();
|
||||
}
|
||||
|
||||
public SubscriptionsUpdatedEvent(Collection<ContactId> affectedContacts) {
|
||||
this.affectedContacts = affectedContacts;
|
||||
}
|
||||
|
||||
/** Returns the contacts affected by the update. */
|
||||
public Collection<ContactId> getAffectedContacts() {
|
||||
return affectedContacts;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package net.sf.briar.api.db.event;
|
||||
|
||||
/** An event that is broadcast when the local transports are updated. */
|
||||
public class TransportsUpdatedEvent extends DatabaseEvent {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user