Allow Validator to access metadata for pending messages

Database queries for metadata only returned it for messages that were delivered already.
However, there are cases (e.g. a pending message needs to be delivered) where
the validator needs to retrieve the metadata from the database.

For these cases, a special database query has been introduced.
This commit is contained in:
Torsten Grote
2016-07-29 15:17:18 -03:00
parent e1bdede4f5
commit bdb876552d
7 changed files with 61 additions and 5 deletions

View File

@@ -262,7 +262,7 @@ public interface DatabaseComponent {
byte[] getRawMessage(Transaction txn, MessageId m) throws DbException;
/**
* Returns the metadata for all messages in the given group.
* Returns the metadata for all delivered messages in the given group.
* <p/>
* Read-only.
*/
@@ -280,13 +280,22 @@ public interface DatabaseComponent {
Metadata query) throws DbException;
/**
* Returns the metadata for the given message.
* Returns the metadata for the given delivered message.
* <p/>
* Read-only.
*/
Metadata getMessageMetadata(Transaction txn, MessageId m)
throws DbException;
/**
* Returns the metadata for the given delivered and pending message.
* This is meant to be only used by the ValidationManager
* <p/>
* Read-only.
*/
Metadata getMessageMetadataForValidator(Transaction txn, MessageId m)
throws DbException;
/**
* Returns the status of all messages in the given group with respect to
* the given contact.