java.lang.Object
i2p.susi.webmail.pop3.DelayedDeleter
Queue UIDLs for later deletion. We send deletions at close time but we don't wait around for the answer. Also, the user may delete mails when offline. So we queue them here and reconnect to delete.
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate classChecks for messages to delete.private classDeletes the waiting messages.Field Summary
FieldsModifier and TypeFieldDescriptionprivate final LogThe log for the deleter.private static final longInterval between the delete checks.private booleanTrue once the deleter is shut down.private booleanTrue while the delete thread runs.private final POP3MailBoxThe mailbox the messages are deleted from.private static final longIdle time before deleting the messages.private final SimpleTimer2.TimedEventThe timer running the delete checks.The message ids waiting to be deleted.Constructor Summary
ConstructorsConstructorDescriptionDelayedDeleter(POP3MailBox mailbox) Creates a new delayed deleter for the given mailbox.Method Summary
All MethodsModifier and TypeMethodDescriptionvoidcancel()Cancels the delayed deleter.Returns the list of queued deletions.voidqueueDelete(String uidl) Queues a UIDL for later deletion.voidremoveQueued(String uidl) Removes a UIDL from the deletion queue.
Field Details
mailbox
The mailbox the messages are deleted from.toDelete
timer
The timer running the delete checks._log
The log for the deleter.isDeleting
private volatile boolean isDeletingTrue while the delete thread runs.isDead
private volatile boolean isDeadTrue once the deleter is shut down.CHECK_TIME
private static final long CHECK_TIMEInterval between the delete checks.- See Also:
MIN_IDLE
private static final long MIN_IDLEIdle time before deleting the messages.- See Also:
Constructor Details
DelayedDeleter
Creates a new delayed deleter for the given mailbox.- Parameters:
mailbox- the POP3 mailbox to delete from
Method Details
queueDelete
Queues a UIDL for later deletion.- Parameters:
uidl- the message UIDL to delete
removeQueued
Removes a UIDL from the deletion queue.- Parameters:
uidl- the message UIDL to remove from queue
getQueued
Returns the list of queued deletions.- Returns:
- a copy of the queued UIDLs
cancel
public void cancel()Cancels the delayed deleter.