Address review comments

This commit is contained in:
Torsten Grote
2016-10-06 12:03:04 -03:00
parent 784561144a
commit 7f2db71160
41 changed files with 171 additions and 159 deletions

View File

@@ -1,22 +1,23 @@
package org.briarproject.api.introduction;
import org.briarproject.api.clients.SessionId;
import org.briarproject.api.clients.BaseMessageHeader;
import org.briarproject.api.clients.SessionId;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId;
import org.jetbrains.annotations.NotNull;
import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRODUCEE;
import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRODUCER;
public class IntroductionMessage extends BaseMessageHeader {
public class IntroductionMessage extends BaseMessageHeader {
private final SessionId sessionId;
private final MessageId messageId;
private final int role;
public IntroductionMessage(SessionId sessionId, MessageId messageId,
GroupId groupId, int role, long time, boolean local, boolean sent,
boolean seen, boolean read) {
public IntroductionMessage(@NotNull SessionId sessionId,
@NotNull MessageId messageId, @NotNull GroupId groupId, int role,
long time, boolean local, boolean sent, boolean seen,
boolean read) {
super(messageId, groupId, time, local, read, sent, seen);
this.sessionId = sessionId;
@@ -24,10 +25,12 @@ import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRO
this.role = role;
}
@NotNull
public SessionId getSessionId() {
return sessionId;
}
@NotNull
public MessageId getMessageId() {
return messageId;
}
@@ -36,9 +39,4 @@ import static org.briarproject.api.introduction.IntroductionConstants.ROLE_INTRO
return role == ROLE_INTRODUCER;
}
public boolean isIntroducee() {
return role == ROLE_INTRODUCEE;
}
}

View File

@@ -4,16 +4,19 @@ import org.briarproject.api.clients.SessionId;
import org.briarproject.api.identity.AuthorId;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
public class IntroductionRequest extends IntroductionResponse {
private final String message;
private final boolean answered, exists, introducesOtherIdentity;
public IntroductionRequest(SessionId sessionId, MessageId messageId,
GroupId groupId, int role, long time, boolean local, boolean sent,
boolean seen, boolean read, AuthorId authorId, String name,
boolean accepted, String message, boolean answered, boolean exists,
public IntroductionRequest(@NotNull SessionId sessionId,
@NotNull MessageId messageId, @NotNull GroupId groupId, int role,
long time, boolean local, boolean sent, boolean seen, boolean read,
AuthorId authorId, String name, boolean accepted,
@Nullable String message, boolean answered, boolean exists,
boolean introducesOtherIdentity) {
super(sessionId, messageId, groupId, role, time, local, sent, seen,
@@ -25,6 +28,7 @@ public class IntroductionRequest extends IntroductionResponse {
this.introducesOtherIdentity = introducesOtherIdentity;
}
@Nullable
public String getMessage() {
return message;
}

View File

@@ -4,6 +4,7 @@ import org.briarproject.api.clients.SessionId;
import org.briarproject.api.identity.AuthorId;
import org.briarproject.api.sync.GroupId;
import org.briarproject.api.sync.MessageId;
import org.jetbrains.annotations.NotNull;
public class IntroductionResponse extends IntroductionMessage {
@@ -11,10 +12,10 @@ public class IntroductionResponse extends IntroductionMessage {
private final String name;
private final boolean accepted;
public IntroductionResponse(SessionId sessionId, MessageId messageId,
GroupId groupId, int role, long time, boolean local, boolean sent,
boolean seen, boolean read, AuthorId remoteAuthorId, String name,
boolean accepted) {
public IntroductionResponse(@NotNull SessionId sessionId,
@NotNull MessageId messageId, @NotNull GroupId groupId, int role,
long time, boolean local, boolean sent, boolean seen, boolean read,
AuthorId remoteAuthorId, String name, boolean accepted) {
super(sessionId, messageId, groupId, role, time, local, sent, seen,
read);