mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-18 21:59:54 +01:00
Move new methods in Database interface to match existing alphabetic sorting
This commit is contained in:
@@ -82,6 +82,12 @@ interface Database<T> {
|
|||||||
void addMessage(T txn, Message m, State state, boolean shared)
|
void addMessage(T txn, Message m, State state, boolean shared)
|
||||||
throws DbException;
|
throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a dependency between two MessageIds
|
||||||
|
*/
|
||||||
|
void addMessageDependency(T txn, MessageId dependentId,
|
||||||
|
MessageId dependencyId) throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Records that a message has been offered by the given contact.
|
* Records that a message has been offered by the given contact.
|
||||||
*/
|
*/
|
||||||
@@ -266,6 +272,26 @@ interface Database<T> {
|
|||||||
*/
|
*/
|
||||||
Collection<LocalAuthor> getLocalAuthors(T txn) throws DbException;
|
Collection<LocalAuthor> getLocalAuthors(T txn) throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the dependencies of the given message.
|
||||||
|
* This method makes sure that dependencies in different groups
|
||||||
|
* are returned as {@link ValidationManager.State.INVALID}. Note that this
|
||||||
|
* is not set on the dependencies themselves; the returned states should
|
||||||
|
* only be taken in the context of the given message.
|
||||||
|
* <p/>
|
||||||
|
* Read-only.
|
||||||
|
*/
|
||||||
|
Map<MessageId, State> getMessageDependencies(T txn, MessageId m)
|
||||||
|
throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns all IDs of messages that depend on the given message.
|
||||||
|
* <p/>
|
||||||
|
* Read-only.
|
||||||
|
*/
|
||||||
|
Map<MessageId, State> getMessageDependents(T txn, MessageId m)
|
||||||
|
throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IDs of all messages in the given group.
|
* Returns the IDs of all messages in the given group.
|
||||||
* <p/>
|
* <p/>
|
||||||
@@ -326,26 +352,6 @@ interface Database<T> {
|
|||||||
MessageStatus getMessageStatus(T txn, ContactId c, MessageId m)
|
MessageStatus getMessageStatus(T txn, ContactId c, MessageId m)
|
||||||
throws DbException;
|
throws DbException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the dependencies of the given message.
|
|
||||||
* This method makes sure that dependencies in different groups
|
|
||||||
* are returned as {@link ValidationManager.State.INVALID}. Note that this
|
|
||||||
* is not set on the dependencies themselves; the returned states should
|
|
||||||
* only be taken in the context of the given message.
|
|
||||||
* <p/>
|
|
||||||
* Read-only.
|
|
||||||
*/
|
|
||||||
Map<MessageId, State> getMessageDependencies(T txn, MessageId m)
|
|
||||||
throws DbException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns all IDs of messages that depend on the given message.
|
|
||||||
* <p/>
|
|
||||||
* Read-only.
|
|
||||||
*/
|
|
||||||
Map<MessageId, State> getMessageDependents(T txn, MessageId m)
|
|
||||||
throws DbException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IDs of some messages received from the given contact that
|
* Returns the IDs of some messages received from the given contact that
|
||||||
* need to be acknowledged, up to the given number of messages.
|
* need to be acknowledged, up to the given number of messages.
|
||||||
@@ -355,6 +361,15 @@ interface Database<T> {
|
|||||||
Collection<MessageId> getMessagesToAck(T txn, ContactId c, int maxMessages)
|
Collection<MessageId> getMessagesToAck(T txn, ContactId c, int maxMessages)
|
||||||
throws DbException;
|
throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the IDs of any messages that need to be delivered to the given
|
||||||
|
* client.
|
||||||
|
* <p/>
|
||||||
|
* Read-only.
|
||||||
|
*/
|
||||||
|
Collection<MessageId> getMessagesToDeliver(T txn, ClientId c)
|
||||||
|
throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IDs of some messages that are eligible to be offered to the
|
* Returns the IDs of some messages that are eligible to be offered to the
|
||||||
* given contact, up to the given number of messages.
|
* given contact, up to the given number of messages.
|
||||||
@@ -364,15 +379,6 @@ interface Database<T> {
|
|||||||
Collection<MessageId> getMessagesToOffer(T txn, ContactId c,
|
Collection<MessageId> getMessagesToOffer(T txn, ContactId c,
|
||||||
int maxMessages) throws DbException;
|
int maxMessages) throws DbException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the IDs of some messages that are eligible to be sent to the
|
|
||||||
* given contact, up to the given total length.
|
|
||||||
* <p/>
|
|
||||||
* Read-only.
|
|
||||||
*/
|
|
||||||
Collection<MessageId> getMessagesToSend(T txn, ContactId c, int maxLength)
|
|
||||||
throws DbException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IDs of some messages that are eligible to be requested from
|
* Returns the IDs of some messages that are eligible to be requested from
|
||||||
* the given contact, up to the given number of messages.
|
* the given contact, up to the given number of messages.
|
||||||
@@ -382,6 +388,15 @@ interface Database<T> {
|
|||||||
Collection<MessageId> getMessagesToRequest(T txn, ContactId c,
|
Collection<MessageId> getMessagesToRequest(T txn, ContactId c,
|
||||||
int maxMessages) throws DbException;
|
int maxMessages) throws DbException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the IDs of some messages that are eligible to be sent to the
|
||||||
|
* given contact, up to the given total length.
|
||||||
|
* <p/>
|
||||||
|
* Read-only.
|
||||||
|
*/
|
||||||
|
Collection<MessageId> getMessagesToSend(T txn, ContactId c, int maxLength)
|
||||||
|
throws DbException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IDs of any messages that need to be validated by the given
|
* Returns the IDs of any messages that need to be validated by the given
|
||||||
* client.
|
* client.
|
||||||
@@ -391,15 +406,6 @@ interface Database<T> {
|
|||||||
Collection<MessageId> getMessagesToValidate(T txn, ClientId c)
|
Collection<MessageId> getMessagesToValidate(T txn, ClientId c)
|
||||||
throws DbException;
|
throws DbException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns the IDs of any messages that need to be delivered to the given
|
|
||||||
* client.
|
|
||||||
* <p/>
|
|
||||||
* Read-only.
|
|
||||||
*/
|
|
||||||
Collection<MessageId> getMessagesToDeliver(T txn, ClientId c)
|
|
||||||
throws DbException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the IDs of any messages that are still pending due to
|
* Returns the IDs of any messages that are still pending due to
|
||||||
* dependencies to other messages for the given client.
|
* dependencies to other messages for the given client.
|
||||||
@@ -579,12 +585,6 @@ interface Database<T> {
|
|||||||
void setMessageState(T txn, MessageId m, State state)
|
void setMessageState(T txn, MessageId m, State state)
|
||||||
throws DbException;
|
throws DbException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Adds a dependency between two MessageIds
|
|
||||||
*/
|
|
||||||
void addMessageDependency(T txn, MessageId dependentId,
|
|
||||||
MessageId dependencyId) throws DbException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the reordering window for the given contact and transport in the
|
* Sets the reordering window for the given contact and transport in the
|
||||||
* given rotation period.
|
* given rotation period.
|
||||||
|
|||||||
Reference in New Issue
Block a user