mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-16 20:59:54 +01:00
Failure reasons
This commit is contained in:
@@ -5,7 +5,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
|||||||
@NotNullByDefault
|
@NotNullByDefault
|
||||||
public interface CustodianTask {
|
public interface CustodianTask {
|
||||||
|
|
||||||
void start(Observer observer);
|
void start(Observer observer, byte[] payload);
|
||||||
|
|
||||||
void cancel();
|
void cancel();
|
||||||
|
|
||||||
|
|||||||
@@ -39,9 +39,31 @@ public interface SecretOwnerTask {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static class Success extends State {
|
public static class Success extends State {
|
||||||
|
private final byte[] remotePayload;
|
||||||
|
|
||||||
|
public Success(byte[] remotePayload) { this.remotePayload = remotePayload; }
|
||||||
|
|
||||||
|
public byte[] getRemotePayload() { return remotePayload; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Failure extends State {
|
public static class Failure extends State {
|
||||||
|
|
||||||
|
public enum Reason {
|
||||||
|
CANCELLED,
|
||||||
|
SECURITY,
|
||||||
|
NO_CONNECTION,
|
||||||
|
OTHER
|
||||||
|
}
|
||||||
|
|
||||||
|
private final Reason reason;
|
||||||
|
|
||||||
|
public Failure(Reason reason) {
|
||||||
|
this.reason = reason;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Reason getReason() {
|
||||||
|
return reason;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user