Run hooks when messages are validated.

This commit is contained in:
akwizgran
2016-02-05 12:08:48 +00:00
parent d75c51ec74
commit 741571bdb8
3 changed files with 34 additions and 0 deletions

View File

@@ -1,5 +1,7 @@
package org.briarproject.api.sync;
import org.briarproject.api.db.Metadata;
/**
* Responsible for managing message validators and passing them messages to
* validate.
@@ -28,4 +30,11 @@ public interface ValidationManager {
/** Sets the message validator for the given client. */
void registerMessageValidator(ClientId c, MessageValidator v);
/** Registers a hook to be called whenever a message is validated. */
void registerValidationHook(ValidationHook hook);
interface ValidationHook {
void validatingMessage(Message m, ClientId c, Metadata meta);
}
}