mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-13 03:09:04 +01:00
Refactor ValidationManager and fix some bugs. #619
This commit is contained in:
@@ -3,22 +3,24 @@ package org.briarproject.api.clients;
|
||||
import org.briarproject.api.data.BdfDictionary;
|
||||
import org.briarproject.api.sync.BaseMessageContext;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class BdfMessageContext extends BaseMessageContext {
|
||||
|
||||
private final BdfDictionary dictionary;
|
||||
|
||||
public BdfMessageContext(BdfDictionary dictionary,
|
||||
Collection<MessageId> dependencies) {
|
||||
public BdfMessageContext(@NotNull BdfDictionary dictionary,
|
||||
@NotNull Collection<MessageId> dependencies) {
|
||||
|
||||
super(dependencies);
|
||||
this.dictionary = dictionary;
|
||||
}
|
||||
|
||||
public BdfMessageContext(BdfDictionary dictionary) {
|
||||
this(dictionary, null);
|
||||
public BdfMessageContext(@NotNull BdfDictionary dictionary) {
|
||||
this(dictionary, Collections.<MessageId>emptyList());
|
||||
}
|
||||
|
||||
public BdfDictionary getDictionary() {
|
||||
|
||||
@@ -5,7 +5,6 @@ import org.briarproject.api.data.BdfDictionary;
|
||||
import org.briarproject.api.data.BdfList;
|
||||
import org.briarproject.api.db.DbException;
|
||||
import org.briarproject.api.db.Transaction;
|
||||
import org.briarproject.api.sync.ClientId;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.Message;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
@@ -15,12 +14,11 @@ import java.util.Map;
|
||||
|
||||
public interface ClientHelper {
|
||||
|
||||
void addLocalMessage(Message m, ClientId c, BdfDictionary metadata,
|
||||
boolean shared) throws DbException, FormatException;
|
||||
void addLocalMessage(Message m, BdfDictionary metadata, boolean shared)
|
||||
throws DbException, FormatException;
|
||||
|
||||
void addLocalMessage(Transaction txn, Message m, ClientId c,
|
||||
BdfDictionary metadata, boolean shared) throws DbException,
|
||||
FormatException;
|
||||
void addLocalMessage(Transaction txn, Message m, BdfDictionary metadata,
|
||||
boolean shared) throws DbException, FormatException;
|
||||
|
||||
Message createMessage(GroupId g, long timestamp, BdfDictionary body)
|
||||
throws FormatException;
|
||||
|
||||
Reference in New Issue
Block a user