mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-15 04:18:53 +01:00
Moved validation interfaces into respective managers.
This commit is contained in:
@@ -2,15 +2,15 @@ package org.briarproject.clients;
|
||||
|
||||
import org.briarproject.api.FormatException;
|
||||
import org.briarproject.api.clients.ClientHelper;
|
||||
import org.briarproject.api.clients.MessageQueueManager.QueueMessageValidator;
|
||||
import org.briarproject.api.clients.QueueMessage;
|
||||
import org.briarproject.api.clients.QueueMessageValidator;
|
||||
import org.briarproject.api.data.BdfDictionary;
|
||||
import org.briarproject.api.data.BdfList;
|
||||
import org.briarproject.api.data.MetadataEncoder;
|
||||
import org.briarproject.api.db.Metadata;
|
||||
import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.Message;
|
||||
import org.briarproject.api.sync.MessageValidator;
|
||||
import org.briarproject.api.sync.ValidationManager.MessageValidator;
|
||||
import org.briarproject.api.system.Clock;
|
||||
import org.briarproject.util.StringUtils;
|
||||
|
||||
@@ -104,7 +104,7 @@ public abstract class BdfMessageValidator implements MessageValidator,
|
||||
}
|
||||
|
||||
protected void checkSize(BdfList list, int minSize, int maxSize)
|
||||
throws FormatException {
|
||||
throws FormatException {
|
||||
if (list != null) {
|
||||
if (list.size() < minSize) throw new FormatException();
|
||||
if (list.size() > maxSize) throw new FormatException();
|
||||
|
||||
@@ -5,7 +5,6 @@ import org.briarproject.api.clients.ClientHelper;
|
||||
import org.briarproject.api.clients.MessageQueueManager;
|
||||
import org.briarproject.api.clients.QueueMessage;
|
||||
import org.briarproject.api.clients.QueueMessageFactory;
|
||||
import org.briarproject.api.clients.QueueMessageValidator;
|
||||
import org.briarproject.api.data.BdfDictionary;
|
||||
import org.briarproject.api.data.BdfList;
|
||||
import org.briarproject.api.db.DatabaseComponent;
|
||||
@@ -17,7 +16,6 @@ import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.Message;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.briarproject.api.sync.MessageValidator;
|
||||
import org.briarproject.api.sync.ValidationManager;
|
||||
import org.briarproject.api.sync.ValidationManager.IncomingMessageHook;
|
||||
import org.briarproject.util.ByteUtils;
|
||||
@@ -146,7 +144,7 @@ class MessageQueueManagerImpl implements MessageQueueManager {
|
||||
}
|
||||
|
||||
private static class DelegatingMessageValidator
|
||||
implements MessageValidator {
|
||||
implements ValidationManager.MessageValidator {
|
||||
|
||||
private final QueueMessageValidator delegate;
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import org.briarproject.api.sync.Group;
|
||||
import org.briarproject.api.sync.GroupId;
|
||||
import org.briarproject.api.sync.Message;
|
||||
import org.briarproject.api.sync.MessageId;
|
||||
import org.briarproject.api.sync.MessageValidator;
|
||||
import org.briarproject.api.sync.ValidationManager;
|
||||
import org.briarproject.util.ByteUtils;
|
||||
|
||||
@@ -74,7 +73,8 @@ class ValidationManagerImpl implements ValidationManager, Service,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerIncomingMessageHook(ClientId c, IncomingMessageHook hook) {
|
||||
public void registerIncomingMessageHook(ClientId c,
|
||||
IncomingMessageHook hook) {
|
||||
hooks.put(c, hook);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user