mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Preliminaries for private group invitation protocol.
This commit is contained in:
@@ -1,19 +0,0 @@
|
||||
package org.briarproject.api.sync;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public abstract class BaseMessageContext {
|
||||
|
||||
private final Collection<MessageId> dependencies;
|
||||
|
||||
public BaseMessageContext(@NotNull Collection<MessageId> dependencies) {
|
||||
this.dependencies = dependencies;
|
||||
}
|
||||
|
||||
public Collection<MessageId> getDependencies() {
|
||||
return dependencies;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,23 +1,27 @@
|
||||
package org.briarproject.api.sync;
|
||||
|
||||
import org.briarproject.api.db.Metadata;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.briarproject.api.nullsafety.NotNullByDefault;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class MessageContext extends BaseMessageContext {
|
||||
import javax.annotation.concurrent.Immutable;
|
||||
|
||||
@Immutable
|
||||
@NotNullByDefault
|
||||
public class MessageContext {
|
||||
|
||||
private final Metadata metadata;
|
||||
private final Collection<MessageId> dependencies;
|
||||
|
||||
public MessageContext(@NotNull Metadata metadata,
|
||||
@NotNull Collection<MessageId> dependencies) {
|
||||
|
||||
super(dependencies);
|
||||
public MessageContext(Metadata metadata,
|
||||
Collection<MessageId> dependencies) {
|
||||
this.metadata = metadata;
|
||||
this.dependencies = dependencies;
|
||||
}
|
||||
|
||||
public MessageContext(@NotNull Metadata metadata) {
|
||||
public MessageContext(Metadata metadata) {
|
||||
this(metadata, Collections.<MessageId>emptyList());
|
||||
}
|
||||
|
||||
@@ -25,4 +29,7 @@ public class MessageContext extends BaseMessageContext {
|
||||
return metadata;
|
||||
}
|
||||
|
||||
public Collection<MessageId> getDependencies() {
|
||||
return dependencies;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,5 +2,7 @@ package org.briarproject.api.sync;
|
||||
|
||||
public interface MessageFactory {
|
||||
|
||||
Message createMessage(GroupId groupId, long timestamp, byte[] body);
|
||||
Message createMessage(GroupId g, long timestamp, byte[] body);
|
||||
|
||||
Message createMessage(MessageId m, byte[] raw);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user