Factor out generic sharing code from ForumSharingManger

This commit is contained in:
str4d
2016-06-16 04:26:49 +00:00
parent 5df2776dc2
commit 9ae64124d3
49 changed files with 1723 additions and 1130 deletions

View File

@@ -4,21 +4,16 @@ import org.briarproject.api.contact.ContactId;
import org.briarproject.api.forum.Forum;
import org.briarproject.api.introduction.IntroductionRequest;
public class ForumInvitationReceivedEvent extends Event {
public class ForumInvitationReceivedEvent extends InvitationReceivedEvent {
private final Forum forum;
private final ContactId contactId;
public ForumInvitationReceivedEvent(Forum forum, ContactId contactId) {
super(contactId);
this.forum = forum;
this.contactId = contactId;
}
public Forum getForum() {
return forum;
}
public ContactId getContactId() {
return contactId;
}
}

View File

@@ -2,23 +2,17 @@ package org.briarproject.api.event;
import org.briarproject.api.contact.ContactId;
public class ForumInvitationResponseReceivedEvent extends Event {
public class ForumInvitationResponseReceivedEvent extends InvitationResponseReceivedEvent {
private final String forumName;
private final ContactId contactId;
public ForumInvitationResponseReceivedEvent(String forumName,
ContactId contactId) {
super(contactId);
this.forumName = forumName;
this.contactId = contactId;
}
public String getForumName() {
return forumName;
}
public ContactId getContactId() {
return contactId;
}
}

View File

@@ -0,0 +1,17 @@
package org.briarproject.api.event;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.forum.Forum;
public abstract class InvitationReceivedEvent extends Event {
private final ContactId contactId;
public InvitationReceivedEvent(ContactId contactId) {
this.contactId = contactId;
}
public ContactId getContactId() {
return contactId;
}
}

View File

@@ -0,0 +1,16 @@
package org.briarproject.api.event;
import org.briarproject.api.contact.ContactId;
public abstract class InvitationResponseReceivedEvent extends Event {
private final ContactId contactId;
public InvitationResponseReceivedEvent(ContactId contactId) {
this.contactId = contactId;
}
public ContactId getContactId() {
return contactId;
}
}