Introduce a MessageContext class for more flexibility

This change will allow to pass message dependencies from the client
validators to the ValidationManager.
This commit is contained in:
Torsten Grote
2016-05-17 18:20:24 -03:00
committed by str4d
parent 8c2fd905a1
commit 3f2b85ac0d
18 changed files with 209 additions and 72 deletions

View File

@@ -2,6 +2,7 @@ package org.briarproject.properties;
import org.briarproject.api.FormatException;
import org.briarproject.api.clients.ClientHelper;
import org.briarproject.api.clients.BdfMessageContext;
import org.briarproject.api.data.BdfDictionary;
import org.briarproject.api.data.BdfList;
import org.briarproject.api.data.MetadataEncoder;
@@ -22,7 +23,7 @@ public class TransportPropertyValidator extends BdfMessageValidator {
}
@Override
protected BdfDictionary validateMessage(Message m, Group g,
protected BdfMessageContext validateMessage(Message m, Group g,
BdfList body) throws FormatException {
// Transport ID, version, properties
checkSize(body, 3);
@@ -45,6 +46,6 @@ public class TransportPropertyValidator extends BdfMessageValidator {
meta.put("transportId", transportId);
meta.put("version", version);
meta.put("local", false);
return meta;
return new BdfMessageContext(meta);
}
}