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

class IdleCloserextends Object
Close the POP3 connection after a certain idle time.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private class 
    Checks the mailbox for idleness.
    private class 
    Closes the idle mailbox connection.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final Log
    The log for the closer.
    private static final int
    Default idle time before closing, less than the five minute timeout of the postman pop3 server.
    private boolean
    True while the close thread runs.
    private boolean
    True once the closer is shut down.
    private final POP3MailBox
    The mailbox watched for idleness.
    private static final int
    Smallest configured idle time.
    The timer running the idle checks.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new idle closer for the given mailbox.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Cancels the idle closer.
    private static long
    The configured idle time.

    Methods inherited from class Object

    clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • mailbox

      private final POP3MailBox mailbox
      The mailbox watched for idleness.
    • timer

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

      private final Log _log
      The log for the closer.
    • isClosing

      private volatile boolean isClosing
      True while the close thread runs.
    • isDead

      private volatile boolean isDead
      True once the closer is shut down.
    • DEFAULT_IDLE_SECONDS

      private static final int DEFAULT_IDLE_SECONDS
      Default idle time before closing, less than the five minute timeout of the postman pop3 server.
      See Also:
    • MIN_IDLE_CONFIG

      private static final int MIN_IDLE_CONFIG
      Smallest configured idle time.
      See Also:
  • Constructor Details

    • IdleCloser

      public IdleCloser(POP3MailBox mailbox)
      Creates a new idle closer for the given mailbox.
      Parameters:
      mailbox - the POP3 mailbox to monitor
  • Method Details

    • cancel

      public void cancel()
      Cancels the idle closer.
    • getMaxIdle

      private static long getMaxIdle()
      The configured idle time.
      Returns:
      the idle time in milliseconds