| java.lang.Object | |
| ↳ | com.google.code.com.sun.mail.iap.Protocol |
Known Direct Subclasses
|
General protocol handling code for IMAP-like protocols.
The Protocol object is multithread safe.
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| CRLF | |||||||||||
| connected | |||||||||||
| debug | |||||||||||
| handlers | |||||||||||
| host | |||||||||||
| input | |||||||||||
| localHostName | |||||||||||
| out | |||||||||||
| output | |||||||||||
| prefix | |||||||||||
| props | |||||||||||
| quote | |||||||||||
| socket | |||||||||||
| tagCounter | |||||||||||
| timestamp | |||||||||||
| traceInput | |||||||||||
| traceOutput | |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
| |||||||||||
Constructor for debugging.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Adds a response handler.
| |||||||||||
Send a command to the server.
| |||||||||||
Returns the timestamp.
| |||||||||||
Convenience routine to handle OK, NO, BAD and BYE responses.
| |||||||||||
Notify response handlers
| |||||||||||
Removed the specified response handler.
| |||||||||||
Convenience routine to handle simple IAP commands
that do not have responses specific to that command.
| |||||||||||
Start TLS on the current connection.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Disconnect.
| |||||||||||
Finalizer.
| |||||||||||
Return the Protocol's InputStream.
| |||||||||||
Get the name of the local host.
| |||||||||||
Return the Protocol's OutputStream
| |||||||||||
Return a buffer to be used to read a response.
| |||||||||||
Returns whether this Protocol supports non-synchronizing literals
Default is false.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Constructor.
Opens a connection to the given host at given port.
| host | Host to connect to |
|---|---|
| port | Portnumber to connect to |
| debug | Debug mode |
| out | Debug output stream |
| props | Properties object used by this protocol |
| prefix | Prefix to prepend to property keys |
| isSSL |
| IOException | |
|---|---|
| ProtocolException |
Constructor for debugging.
| in | |
|---|---|
| out | |
| debug |
| IOException |
|---|
Send a command to the server. Collect all responses until either the corresponding command completion response or a BYE response (indicating server failure). Return all the collected responses.
| command | The command |
|---|---|
| args | The arguments |
Returns the timestamp.
Convenience routine to handle OK, NO, BAD and BYE responses.
| response |
|---|
| ProtocolException |
|---|
Notify response handlers
| responses |
|---|
Removed the specified response handler.
| h |
|---|
Convenience routine to handle simple IAP commands that do not have responses specific to that command.
| cmd | |
|---|---|
| args |
| ProtocolException |
|---|
Start TLS on the current connection.
cmd is the command to issue to start TLS negotiation.
If the command succeeds, we begin TLS negotiation.
| cmd |
|---|
| IOException | |
|---|---|
| ProtocolException |
Disconnect.
Finalizer.
| Throwable |
|---|
Get the name of the local host.
The property
Return the Protocol's OutputStream
Return a buffer to be used to read a response. The default implementation returns null, which causes a new buffer to be allocated for every response.
Returns whether this Protocol supports non-synchronizing literals Default is false. Subclasses should override this if required