Class ImapServer

java.lang.Object
net.messagevortex.transport.ListeningSocketChannel
net.messagevortex.transport.imap.ImapServer
All Implemented Interfaces:
SocketListener, StoppableThread

public class ImapServer extends ListeningSocketChannel implements StoppableThread, SocketListener
  • Constructor Details

    • ImapServer

      public ImapServer(SecurityContext secContext) throws IOException

      Creates an IMAP server listening the default port on all interfaces of the server.

      Parameters:
      secContext - the security context for the server
      Throws:
      IOException - if socket binding fails
    • ImapServer

      public ImapServer(InetSocketAddress addr, SecurityContext enc) throws IOException

      Creates an IMAP server listening on the specified socket address.

      Parameters:
      addr - the socket address to be used by the server
      enc - the security context for the server
      Throws:
      IOException - if socket binding fails
  • Method Details

    • setAuth

      Sets the authentication proxy for incoming connections.

      Parameters:
      ap - the new proxy
      Returns:
      the previously set proxy
    • gotConnect

      public void gotConnect(ServerConnection ac)
      Specified by:
      gotConnect in interface SocketListener
    • isShutdown

      public boolean isShutdown()
      Description copied from interface: StoppableThread

      Query if the process is marked for shutdown.

      Specified by:
      isShutdown in interface StoppableThread
      Overrides:
      isShutdown in class ListeningSocketChannel
      Returns:
      true if the thread is marked for shutdown
    • shutdown

      public void shutdown()
      Description copied from class: ListeningSocketChannel

      Shutdown the socket channel.

      Specified by:
      shutdown in interface StoppableThread
      Overrides:
      shutdown in class ListeningSocketChannel
    • getTimeout

      public long getTimeout()

      Gets the timeout for new incoming connections.

      Returns:
      the currently set timeout
    • setTimeout

      public long setTimeout(long timeout)

      Sets the timeout for new incoming connections.

      Parameters:
      timeout - the timeout in milli seconds
      Returns:
      the previously set timeout