Package net.messagevortex.transport.imap
Class ImapClient
java.lang.Object
net.messagevortex.transport.AbstractConnection
net.messagevortex.transport.ClientConnection
net.messagevortex.transport.imap.ImapClient
-
Field Summary
Fields inherited from class net.messagevortex.transport.AbstractConnection
CRLF -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanauthenticate(Credentials creds) Authenticate with the strongest offered authentication scheme.booleanauthenticate(Credentials creds, SaslMechanisms mech) Authenticate with the specified SASL mechanism.voidInitiate a TLS handshake by issuing a STARTTLS command.voidprocessLine(String line) voidrun()the processing methode of the running thread.String[]sendCommand(String command) Send a command to an IMAP server.String[]sendCommand(String command, long millisTimeout) Send a command to an IMAP server.Methods inherited from class net.messagevortex.transport.ClientConnection
shutdownMethods inherited from class net.messagevortex.transport.AbstractConnection
closeConnection, connect, do_handshake, do_teardown, enlargeApplicationBuffer, enlargeBuffer, enlargePacketBuffer, getDefaultTimeout, getEngine, getHostName, getPort, getProtocol, getSecurityContext, getSocketChannel, getTimeout, handleBufferUnderflow, handleEndOfStream, isShutdown, isTls, read, read, readln, readln, setDefaultTimeout, setEngine, setProtocol, setSecurityContext, setSocketChannel, setTimeout, startTls, startTls, write, write, writeln, writeln
-
Constructor Details
-
ImapClient
- Throws:
IOException
-
-
Method Details
-
imapStartTls
Initiate a TLS handshake by issuing a STARTTLS command.
- Throws:
IOException- if handshake fails or a timeout is reached
-
authenticate
Authenticate with the strongest offered authentication scheme.
- Parameters:
creds- The credentials to be used for the authentication- Returns:
- true if successful
- Throws:
TimeoutException- if reaching a timeout while reading
-
authenticate
Authenticate with the specified SASL mechanism.
- Parameters:
creds- the credentials to be usedmech- the SASL mechanism to be used- Returns:
- true if successful
- Throws:
TimeoutException- if reaching a timeout while reading
-
sendCommand
Send a command to an IMAP server.
This is a blocking command honoring timeouts. The Timeout used is the default timeout.
- Parameters:
command- the command to be issued- Returns:
- an array of lines gotten in return of the command
- Throws:
TimeoutException- if a timeout has bee reached
-
sendCommand
Send a command to an IMAP server.
This is a blocking command honoring timeouts. The Timeout used is the default timeout.
- Parameters:
command- the command to be issuedmillisTimeout- The timeout in milliseconds- Returns:
- an array of lines gotten in return of the command
- Throws:
TimeoutException- if a timeout has bee reached
-
processLine
- Throws:
IOExceptionTimeoutException
-
run
public void run()the processing methode of the running thread.
Do not call this method!
FIXME: move to a private runner.
-