Refactor SharingManager so its events provide message header

This commit is contained in:
Torsten Grote
2016-10-05 09:20:02 -03:00
parent 064b920626
commit 1731369d7a
28 changed files with 253 additions and 102 deletions

View File

@@ -2,13 +2,15 @@ package org.briarproject.api.event;
import org.briarproject.api.blogs.Blog;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.sharing.InvitationRequest;
public class BlogInvitationReceivedEvent extends InvitationReceivedEvent {
private final Blog blog;
public BlogInvitationReceivedEvent(Blog blog, ContactId contactId) {
super(contactId);
public BlogInvitationReceivedEvent(Blog blog, ContactId contactId,
InvitationRequest request) {
super(contactId, request);
this.blog = blog;
}

View File

@@ -1,5 +1,6 @@
package org.briarproject.api.event;
import org.briarproject.api.blogs.BlogInvitationResponse;
import org.briarproject.api.contact.ContactId;
public class BlogInvitationResponseReceivedEvent extends InvitationResponseReceivedEvent {
@@ -7,8 +8,8 @@ public class BlogInvitationResponseReceivedEvent extends InvitationResponseRecei
private final String blogTitle;
public BlogInvitationResponseReceivedEvent(String blogTitle,
ContactId contactId) {
super(contactId);
ContactId contactId, BlogInvitationResponse response) {
super(contactId, response);
this.blogTitle = blogTitle;
}

View File

@@ -2,17 +2,20 @@ package org.briarproject.api.event;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.forum.Forum;
import org.briarproject.api.forum.ForumInvitationRequest;
public class ForumInvitationReceivedEvent extends InvitationReceivedEvent {
private final Forum forum;
public ForumInvitationReceivedEvent(Forum forum, ContactId contactId) {
super(contactId);
public ForumInvitationReceivedEvent(Forum forum, ContactId contactId,
ForumInvitationRequest request) {
super(contactId, request);
this.forum = forum;
}
public Forum getForum() {
return forum;
}
}

View File

@@ -1,14 +1,15 @@
package org.briarproject.api.event;
import org.briarproject.api.contact.ContactId;
import org.briarproject.api.forum.ForumInvitationResponse;
public class ForumInvitationResponseReceivedEvent extends InvitationResponseReceivedEvent {
private final String forumName;
public ForumInvitationResponseReceivedEvent(String forumName,
ContactId contactId) {
super(contactId);
ContactId contactId, ForumInvitationResponse response) {
super(contactId, response);
this.forumName = forumName;
}

View File

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

View File

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