Package net.messagevortex.transport.imap
Class ImapServer
java.lang.Object
net.messagevortex.transport.ListeningSocketChannel
net.messagevortex.transport.imap.ImapServer
- All Implemented Interfaces:
SocketListener,StoppableThread
-
Constructor Summary
ConstructorsConstructorDescriptionImapServer(InetSocketAddress addr, SecurityContext enc) Creates an IMAP server listening on the specified socket address.ImapServer(SecurityContext secContext) Creates an IMAP server listening the default port on all interfaces of the server. -
Method Summary
Modifier and TypeMethodDescriptionlongGets the timeout for new incoming connections.voidbooleanQuery if the process is marked for shutdown.Sets the authentication proxy for incoming connections.longsetTimeout(long timeout) Sets the timeout for new incoming connections.voidshutdown()Shutdown the socket channel.Methods inherited from class net.messagevortex.transport.ListeningSocketChannel
getName, getPort, getProtocol, getSecurityContext, getSocketListener, setName, setProtocol, setSecurityContext, setSocketListener
-
Constructor Details
-
ImapServer
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
Creates an IMAP server listening on the specified socket address.
- Parameters:
addr- the socket address to be used by the serverenc- 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
- Specified by:
gotConnectin interfaceSocketListener
-
isShutdown
public boolean isShutdown()Description copied from interface:StoppableThreadQuery if the process is marked for shutdown.
- Specified by:
isShutdownin interfaceStoppableThread- Overrides:
isShutdownin classListeningSocketChannel- Returns:
- true if the thread is marked for shutdown
-
shutdown
public void shutdown()Description copied from class:ListeningSocketChannelShutdown the socket channel.
- Specified by:
shutdownin interfaceStoppableThread- Overrides:
shutdownin classListeningSocketChannel
-
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
-