Add an IntroductionManager and Validator

This Introduction BSP Client uses its own group to communicate with
existing contacts. It uses four types of messages to facilitate
introductions: the introduction, the response, the ack and the abort.

The protocol logic is encapsulated in two protocol engines, one for the
introducer and one for the introducee. The introduction client keeps the
local state for each engine, hands messages over to the engines and
processes the result and state changes they return.
This commit is contained in:
Torsten Grote
2016-01-21 10:10:40 -02:00
parent e3459fb0a3
commit f44cb5ff94
26 changed files with 2770 additions and 2 deletions

View File

@@ -0,0 +1,54 @@
package org.briarproject.api.introduction;
import org.briarproject.api.sync.MessageId;
abstract public class IntroductionMessage {
private final SessionId sessionId;
private final MessageId messageId;
private final long time;
private final boolean local, sent, seen, read;
public IntroductionMessage(SessionId sessionId, MessageId messageId,
long time, boolean local, boolean sent, boolean seen,
boolean read) {
this.sessionId = sessionId;
this.messageId = messageId;
this.time = time;
this.local = local;
this.sent = sent;
this.seen = seen;
this.read = read;
}
public SessionId getSessionId() {
return sessionId;
}
public long getTime() {
return time;
}
public MessageId getMessageId() {
return messageId;
}
public boolean isLocal() {
return local;
}
public boolean isSent() {
return sent;
}
public boolean isSeen() {
return seen;
}
public boolean isRead() {
return read;
}
}