Refactor ValidationManager and fix some bugs. #619

This commit is contained in:
akwizgran
2016-09-08 14:57:41 +01:00
parent fd4275733f
commit 8a3e5bfb50
34 changed files with 978 additions and 922 deletions

View File

@@ -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() {

View File

@@ -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;