Class IMAPStore


  • public class IMAPStore
    extends Store
    The storage class implementing the IMAP4rev1 mail protocol.
    Author:
    Chris Burdess
    • Field Detail

      • connection

        protected org.jpackage.mail.inet.imap.IMAPConnection connection
        The connection to the IMAP server.
      • root

        protected IMAPFolder root
        Folder representing the root namespace of the IMAP connection.
      • selected

        protected IMAPFolder selected
        The currently selected folder.
    • Constructor Detail

      • IMAPStore

        public IMAPStore​(Session session,
                         URLName url)
        Constructor.
    • Method Detail

      • protocolConnect

        protected boolean protocolConnect​(java.lang.String host,
                                          int port,
                                          java.lang.String username,
                                          java.lang.String password)
                                   throws MessagingException
        Connects to the IMAP server and authenticates with the specified parameters.
        Overrides:
        protocolConnect in class Service
        Parameters:
        host - the name of the host to connect to
        port - the port to use (-1 for the default port)
        username - the username
        password - the password
        Returns:
        true on success, false if authentication failed
        Throws:
        AuthenticationFailedException - on authentication failure
        MessagingException - for non-authentication failures
      • isConnected

        public boolean isConnected()
        Uses a NOOP to ensure that the connection to the IMAP server is still valid.
        Overrides:
        isConnected in class Service
      • getConnection

        protected org.jpackage.mail.inet.imap.IMAPConnection getConnection()
                                                                    throws StoreClosedException
        Returns the IMAP connection used by this store.
        Throws:
        StoreClosedException - if the store is not currently connected
      • isSelected

        protected boolean isSelected​(IMAPFolder folder)
        Indicates whether the specified folder is selected.
      • setSelected

        protected void setSelected​(IMAPFolder folder)
        Sets the selected folder.
      • processAlerts

        protected void processAlerts()
        Process any alerts supplied by the server.
      • getQuota

        public org.jpackage.mail.inet.imap.Quota getQuota​(java.lang.String root)
                                                   throws MessagingException
        Returns the quota for the specified quota root.
        Parameters:
        root - the quota root
        Throws:
        MessagingException
      • setQuota

        public void setQuota​(java.lang.String root,
                             org.jpackage.mail.inet.imap.Quota.Resource[] resources)
                      throws MessagingException
        Sets the quota resource set for the specified quota root.
        Parameters:
        root - the quota root
        resources - the quota resources to set
        Throws:
        MessagingException