Updated group-related events and exceptions.

This commit is contained in:
akwizgran
2016-01-27 17:29:17 +00:00
parent 9d537dce00
commit 3837efca6b
23 changed files with 159 additions and 226 deletions

View File

@@ -2,12 +2,12 @@ package org.briarproject.api.event;
import org.briarproject.api.sync.Group;
/** An event that is broadcast when the user subscribes to a group. */
public class SubscriptionAddedEvent extends Event {
/** An event that is broadcast when a group is added. */
public class GroupAddedEvent extends Event {
private final Group group;
public SubscriptionAddedEvent(Group group) {
public GroupAddedEvent(Group group) {
this.group = group;
}

View File

@@ -2,12 +2,12 @@ package org.briarproject.api.event;
import org.briarproject.api.sync.Group;
/** An event that is broadcast when the user unsubscribes from a group. */
public class SubscriptionRemovedEvent extends Event {
/** An event that is broadcast when a group is removed. */
public class GroupRemovedEvent extends Event {
private final Group group;
public SubscriptionRemovedEvent(Group group) {
public GroupRemovedEvent(Group group) {
this.group = group;
}

View File

@@ -4,15 +4,12 @@ import org.briarproject.api.contact.ContactId;
import java.util.Collection;
/**
* An event that is broadcast when the set of subscriptions visible to one or
* more contacts is updated.
*/
public class LocalSubscriptionsUpdatedEvent extends Event {
/** An event that is broadcast when the visibility of a group is updated. */
public class GroupVisibilityUpdatedEvent extends Event {
private final Collection<ContactId> affected;
public LocalSubscriptionsUpdatedEvent(Collection<ContactId> affected) {
public GroupVisibilityUpdatedEvent(Collection<ContactId> affected) {
this.affected = affected;
}

View File

@@ -1,17 +0,0 @@
package org.briarproject.api.event;
import org.briarproject.api.contact.ContactId;
/** An event that is broadcast when a contact's subscriptions are updated. */
public class RemoteSubscriptionsUpdatedEvent extends Event {
private final ContactId contactId;
public RemoteSubscriptionsUpdatedEvent(ContactId contactId) {
this.contactId = contactId;
}
public ContactId getContactId() {
return contactId;
}
}