Moved validation interfaces into respective managers.

This commit is contained in:
akwizgran
2016-03-08 16:18:52 +00:00
parent d308a30d05
commit efa06527c9
8 changed files with 44 additions and 39 deletions

View File

@@ -41,7 +41,20 @@ public interface ValidationManager {
*/
void registerIncomingMessageHook(ClientId c, IncomingMessageHook hook);
interface MessageValidator {
/**
* Validates the given message and returns its metadata if the message
* is valid, or null if the message is invalid.
*/
Metadata validateMessage(Message m, Group g);
}
interface IncomingMessageHook {
/**
* Called once for each incoming message that passes validation.
*/
void incomingMessage(Transaction txn, Message m, Metadata meta)
throws DbException;
}