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

class BackgroundCheckerextends Object
Check for new mail periodically.
  • Field Details

    • mailbox

      private final POP3MailBox mailbox
      The mailbox checked in the background.
    • toDelete

      private final Set<String> toDelete
      The message ids marked for deletion.
    • timer

      private final SimpleTimer2.TimedEvent timer
      The timer scheduling the checks.
    • isChecking

      private volatile boolean isChecking
      True while a check is running.
    • isDead

      private volatile boolean isDead
      True once the mailbox is shut down.
    • _log

      private final Log _log
      Logger for the background checker.
    • DEFAULT_CHECK_MINUTES

      private static final int DEFAULT_CHECK_MINUTES
      Default interval between the checks, in minutes.
      See Also:
    • MIN_CHECK_MINUTES

      private static final int MIN_CHECK_MINUTES
      Smallest check interval allowed, in minutes.
      See Also:
    • MIN_IDLE

      private static final long MIN_IDLE
      Least idle time before a check runs.
      See Also:
    • MIN_SINCE

      private static final long MIN_SINCE
      Least time since the last check.
      See Also:
  • Constructor Details

    • BackgroundChecker

      public BackgroundChecker(POP3MailBox mailbox)
      Creates a new background checker for the given mailbox.
      Parameters:
      mailbox - the POP3 mailbox to check for new mail
  • Method Details

    • getQueued

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

      public void cancel()
      Cancels the background checker.
    • getCheckTime

      private long getCheckTime()
      Reads the check interval from the config.
      Returns:
      the interval between checks, in ms