java.lang.Object
i2p.susi.webmail.pop3.DelayedDeleter

class DelayedDeleterextends Object
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.
  • Field Details

    • mailbox

      private final POP3MailBox mailbox
      The mailbox the messages are deleted from.
    • toDelete

      private final Set<String> toDelete
      The message ids waiting to be deleted.
    • timer

      private final SimpleTimer2.TimedEvent timer
      The timer running the delete checks.
    • _log

      private final Log _log
      The log for the deleter.
    • isDeleting

      private volatile boolean isDeleting
      True while the delete thread runs.
    • isDead

      private volatile boolean isDead
      True once the deleter is shut down.
    • CHECK_TIME

      private static final long CHECK_TIME
      Interval between the delete checks.
      See Also:
    • MIN_IDLE

      private static final long MIN_IDLE
      Idle time before deleting the messages.
      See Also:
  • Constructor Details

    • DelayedDeleter

      public DelayedDeleter(POP3MailBox mailbox)
      Creates a new delayed deleter for the given mailbox.
      Parameters:
      mailbox - the POP3 mailbox to delete from
  • Method Details

    • queueDelete

      public void queueDelete(String uidl)
      Queues a UIDL for later deletion.
      Parameters:
      uidl - the message UIDL to delete
    • removeQueued

      public void removeQueued(String uidl)
      Removes a UIDL from the deletion queue.
      Parameters:
      uidl - the message UIDL to remove from queue
    • getQueued

      public Collection<String> getQueued()
      Returns the list of queued deletions.
      Returns:
      a copy of the queued UIDLs
    • cancel

      public void cancel()
      Cancels the delayed deleter.