mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Pass message IDs to cleanup hooks in batches.
This commit is contained in:
@@ -7,6 +7,8 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
|
||||
import org.briarproject.bramble.api.sync.GroupId;
|
||||
import org.briarproject.bramble.api.sync.MessageId;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* An interface for registering a hook with the {@link CleanupManager}
|
||||
* that will be called when a message's cleanup deadline is reached.
|
||||
@@ -15,12 +17,10 @@ import org.briarproject.bramble.api.sync.MessageId;
|
||||
public interface CleanupHook {
|
||||
|
||||
/**
|
||||
* Called when a message's cleanup deadline is reached. If this method
|
||||
* returns true, a {@link MessagesCleanedUpEvent} will be broadcast.
|
||||
*
|
||||
* @return True if the message has been deleted, or false if it has not,
|
||||
* in which case the message's cleanup timer will be stopped
|
||||
* Called when the cleanup deadlines of one or more messages are reached.
|
||||
* When this method returns, a {@link MessagesCleanedUpEvent} will be
|
||||
* broadcast.
|
||||
*/
|
||||
boolean deleteMessage(Transaction txn, GroupId g, MessageId m)
|
||||
throws DbException;
|
||||
void deleteMessages(Transaction txn, GroupId g,
|
||||
Collection<MessageId> messageIds) throws DbException;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user