DatabaseComponent.generateBatch() now returns a boolean.

This allows a connection to know whether to try writing another batch
immediately, or to wait for an event from the DB.
This commit is contained in:
akwizgran
2011-09-20 14:45:07 +01:00
parent 75446b7f7e
commit 5548eb32cd
3 changed files with 24 additions and 24 deletions

View File

@@ -73,17 +73,21 @@ public interface DatabaseComponent {
void generateAck(ContactId c, AckWriter a) throws DbException,
IOException;
/** Generates a batch of messages for the given contact. */
void generateBatch(ContactId c, BatchWriter b) throws DbException,
/**
* Generates a batch of messages for the given contact.
* @return True if any messages were added to tbe batch.
*/
boolean generateBatch(ContactId c, BatchWriter b) throws DbException,
IOException;
/**
* Generates a batch of messages for the given contact from the given
* collection of requested messages, and returns the IDs of any messages
* that were either added to the batch, or were considered for inclusion
* but are no longer sendable to the contact.
* collection of requested messages. Any messages that were either added to
* the batch, or were considered but are no longer sendable to the contact,
* are removed from the collection of requested messages before returning.
* @return True if any messages were added to the batch.
*/
Collection<MessageId> generateBatch(ContactId c, BatchWriter b,
boolean generateBatch(ContactId c, BatchWriter b,
Collection<MessageId> requested) throws DbException, IOException;
/**