Allow messages to be deleted in delivery hook

This commit is contained in:
Torsten Grote
2016-11-03 18:42:26 -02:00
parent e810a1265a
commit 3f9a254a0b
10 changed files with 103 additions and 113 deletions

View File

@@ -55,9 +55,20 @@ public interface ValidationManager {
/**
* Called once for each incoming message that passes validation.
*
* @return whether or not this message should be shared
* @throws DbException should only be used for real database errors
* @throws InvalidMessageException for any non-database error
* that occurs while handling remotely created data.
* This includes errors that occur while handling locally created data
* in a context controlled by remotely created data
* (for example, parsing the metadata of a dependency
* of an incoming message).
* Throwing this will delete the incoming message and its metadata
* marking it as invalid in the database.
* Never rethrow DbException as InvalidMessageException
*/
boolean incomingMessage(Transaction txn, Message m, Metadata meta)
throws DbException;
throws DbException, InvalidMessageException;
}
}