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,36 @@
package org.briarproject.api.introduction;
import org.briarproject.api.identity.AuthorId;
import org.briarproject.api.sync.MessageId;
public class IntroductionRequest extends IntroductionResponse {
private final String message;
private final boolean answered, exists;
public IntroductionRequest(SessionId sessionId, MessageId messageId,
long time, boolean local, boolean sent, boolean seen, boolean read,
AuthorId authorId, String name, boolean accepted, String message,
boolean answered, boolean exists) {
super(sessionId, messageId, time, local, sent, seen, read, authorId,
name, accepted);
this.message = message;
this.answered = answered;
this.exists = exists;
}
public String getMessage() {
return message;
}
public boolean wasAnswered() {
return answered;
}
public boolean doesExist() {
return exists;
}
}