| java.lang.Object | ||
| ↳ | com.google.code.com.sun.mail.iap.Protocol | |
| ↳ | com.google.code.com.sun.mail.imap.protocol.IMAPProtocol | |
This class extends the iap.Protocol object and implements IMAP
semantics. In general, there is a method corresponding to each
IMAP protocol command. The typical implementation issues the
appropriate protocol command, collects all responses, processes
those responses that are specific to this command and then
dispatches the rest (the unsolicited ones) to the dispatcher
using the notifyResponseHandlers(r).
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| CRLF | |||||||||||
| DONE | |||||||||||
| authenticated | |||||||||||
| authmechs | |||||||||||
| ba | |||||||||||
| capabilities | |||||||||||
| connected | |||||||||||
| idleTag | |||||||||||
| name | |||||||||||
| rev1 | |||||||||||
| saslAuthenticator | |||||||||||
| searchCharsets | |||||||||||
|
[Expand]
Inherited Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.com.sun.mail.iap.Protocol
| |||||||||||
| Public Constructors | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Constructor.
| |||||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
APPEND Command.
| |||||||||||
APPEND Command, return uid from APPENDUID response code.
| |||||||||||
The AUTHENTICATE command with AUTH=LOGIN authenticate scheme
| |||||||||||
The AUTHENTICATE command with AUTH=NTLM authentication scheme.
| |||||||||||
The AUTHENTICATE command with AUTH=PLAIN authentication scheme.
| |||||||||||
CAPABILITY command.
| |||||||||||
CHECK Command.
| |||||||||||
CLOSE Command.
| |||||||||||
COPY command.
| |||||||||||
CREATE Command.
| |||||||||||
DELETE Command.
| |||||||||||
DELETEACL Command.
| |||||||||||
Close socket connection.
| |||||||||||
EXAMINE Command.
| |||||||||||
EXPUNGE Command.
| |||||||||||
Fetch given BODY section.
| |||||||||||
Partial FETCH of given BODY section.
| |||||||||||
Partial FETCH of given BODY section.
| |||||||||||
Fetch the BODYSTRUCTURE of the specified message.
| |||||||||||
Fetch the FLAGS for the given message.
| |||||||||||
Fetch the specified RFC822 Data item.
| |||||||||||
Get the sequence number for the given UID.
| |||||||||||
Get the sequence numbers for UIDs ranging from start till end.
| |||||||||||
Get the sequence numbers for UIDs ranging from start till end.
| |||||||||||
Fetch the IMAP UID for the given message.
| |||||||||||
GETACL Command.
| |||||||||||
Return the map of capabilities returned by the server.
| |||||||||||
GETQUOTA Command.
| |||||||||||
GETQUOTAROOT Command.
| |||||||||||
Check whether the given capability is supported by
this server.
| |||||||||||
ID Command, for Yahoo! Mail IMAP server.
| |||||||||||
Abort an IDLE command.
| |||||||||||
IDLE Command.
| |||||||||||
Returns
true if the connection has been authenticated,
either due to a successful login, or due to a PREAUTH greeting response. | |||||||||||
Returns
true if this is a IMAP4rev1 server
| |||||||||||
LIST Command.
| |||||||||||
LISTRIGHTS Command.
| |||||||||||
LOGIN Command.
| |||||||||||
LOGOUT Command.
| |||||||||||
LSUB Command.
| |||||||||||
MYRIGHTS Command.
| |||||||||||
NAMESPACE Command.
| |||||||||||
The NOOP command.
| |||||||||||
Partial FETCH of given BODY section, without setting SEEN flag.
| |||||||||||
Partial FETCH of given BODY section, without setting SEEN flag.
| |||||||||||
Fetch given BODY section, without marking the message
as SEEN.
| |||||||||||
Process a response returned by readIdleResponse().
| |||||||||||
PROXYAUTH Command.
| |||||||||||
While an IDLE command is in progress, read a response
sent from the server.
| |||||||||||
Read a response from the server.
| |||||||||||
RENAME Command.
| |||||||||||
SASL-based login.
| |||||||||||
Issue the given search criterion on all messages in this folder.
| |||||||||||
Issue the given search criterion on the specified message sets.
| |||||||||||
SELECT Command.
| |||||||||||
SETACL Command.
| |||||||||||
SETQUOTA Command.
| |||||||||||
Sort messages in the folder according to the specified sort criteria.
| |||||||||||
STARTTLS Command.
| |||||||||||
STATUS Command.
| |||||||||||
Set the specified flags on this message.
| |||||||||||
SUBSCRIBE Command.
| |||||||||||
UID EXPUNGE Command.
| |||||||||||
UNSELECT Command.
| |||||||||||
UNSUBSCRIBE Command.
| |||||||||||
XLIST Command.
| |||||||||||
| Protected Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Return a buffer to read a response into.
| |||||||||||
Parse the capabilities from a CAPABILITY response or from
a CAPABILITY response code attached to (e.g.) an OK response.
| |||||||||||
Check the greeting when first connecting; look for PREAUTH response.
| |||||||||||
If the response contains a CAPABILITY response code, extract
it and save the capabilities.
| |||||||||||
Returns whether this Protocol supports non-synchronizing literals.
| |||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
com.google.code.com.sun.mail.iap.Protocol
| |||||||||||
From class
java.lang.Object
| |||||||||||
Constructor. Opens a connection to the given host at given port.
| name | |
|---|---|
| host | Host to connect to |
| port | Portnumber to connect to |
| debug | Debug mode |
| out | |
| props | Properties object used by this protocol |
| isSSL |
| IOException | |
|---|---|
| ProtocolException |
APPEND Command, return uid from APPENDUID response code.
| mbox | |
|---|---|
| f | |
| d | |
| data |
| ProtocolException |
|---|
The AUTHENTICATE command with AUTH=LOGIN authenticate scheme
| u | |
|---|---|
| p |
| ProtocolException |
|---|
The AUTHENTICATE command with AUTH=NTLM authentication scheme.
This is based heavly on the authlogin(String, String) method.
| authzid | The authorization id |
|---|---|
| u | The username |
| p | The password |
| ProtocolException | as thrown by handleResult(Response). |
|---|
The AUTHENTICATE command with AUTH=PLAIN authentication scheme.
This is based heavly on the authlogin(String, String) method.
| authzid | The authorization id |
|---|---|
| u | The username |
| p | The password |
| ProtocolException | as thrown by handleResult(Response). |
|---|
Close socket connection. This method just makes the Protocol.disconnect() method public.
Partial FETCH of given BODY section.
| msgno | |
|---|---|
| section | |
| start | |
| size | |
| ba |
| ProtocolException |
|---|
Fetch the specified RFC822 Data item. 'what' names
the item to be fetched. 'what' can be null
to fetch the whole message.
| msgno | |
|---|---|
| what |
| ProtocolException |
|---|
Get the sequence number for the given UID. A UID object
containing the sequence number is returned. If the given UID
is invalid, null is returned.
| uid |
|---|
| ProtocolException |
|---|
Get the sequence numbers for UIDs ranging from start till end. UID objects that contain the sequence numbers are returned. If no UIDs in the given range are found, an empty array is returned.
| uids |
|---|
| ProtocolException |
|---|
Get the sequence numbers for UIDs ranging from start till end. UID objects that contain the sequence numbers are returned. If no UIDs in the given range are found, an empty array is returned.
| start | |
|---|---|
| end |
| ProtocolException |
|---|
Return the map of capabilities returned by the server.
GETQUOTA Command. Returns an array of Quota objects, representing the quotas for this quotaroot.
| root |
|---|
| ProtocolException |
|---|
GETQUOTAROOT Command. Returns an array of Quota objects, representing the quotas for this mailbox and, indirectly, the quotaroots for this mailbox.
| mbox |
|---|
| ProtocolException |
|---|
Check whether the given capability is supported by
this server. Returns true if so, otherwise
returns false.
| c |
|---|
ID Command, for Yahoo! Mail IMAP server.
| guid |
|---|
| ProtocolException |
|---|
Abort an IDLE command. While one thread is blocked in readIdleResponse(), another thread will use this method to abort the IDLE command, which will cause the server to send the closing tag for the IDLE command, which readIdleResponse() and processIdleResponse() will see and terminate the IDLE state.
| ProtocolException |
|---|
IDLE Command.
If the server supports the IDLE command extension, the IDLE command is issued and this method blocks until a response has been received. Once the first response has been received, the IDLE command is terminated and all responses are collected and handled and this method returns.
Note that while this method is blocked waiting for a response, no other threads may issue any commands to the server that would use this same connection.
| ProtocolException |
|---|
Returns true if the connection has been authenticated,
either due to a successful login, or due to a PREAUTH greeting response.
Returns true if this is a IMAP4rev1 server
Partial FETCH of given BODY section, without setting SEEN flag.
| msgno | |
|---|---|
| section | |
| start | |
| size | |
| ba |
| ProtocolException |
|---|
Partial FETCH of given BODY section, without setting SEEN flag.
| msgno | |
|---|---|
| section | |
| start | |
| size |
| ProtocolException |
|---|
Fetch given BODY section, without marking the message as SEEN.
| msgno | |
|---|---|
| section |
| ProtocolException |
|---|
Process a response returned by readIdleResponse(). This method will be called with appropriate locks held so that the processing of the response is safe.
| r |
|---|
| ProtocolException |
|---|
PROXYAUTH Command.
| u |
|---|
| ProtocolException |
|---|
While an IDLE command is in progress, read a response sent from the server. The response is read with no locks held so that when the read blocks waiting for the response from the server it's not holding locks that would prevent other threads from interrupting the IDLE command.
Read a response from the server.
| IOException | |
|---|---|
| ProtocolException |
Issue the given search criterion on all messages in this folder. Returns array of matching sequence numbers. An empty array is returned if no matches are found.
| term | SearchTerm |
|---|
| ProtocolException | |
|---|---|
| SearchException |
Issue the given search criterion on the specified message sets. Returns array of matching sequence numbers. An empty array is returned if no matches are found.
| msgsets | Array of MessageSets |
|---|---|
| term | SearchTerm |
| ProtocolException | |
|---|---|
| SearchException |
SETQUOTA Command. Set the indicated quota on the corresponding quotaroot.
| quota |
|---|
| ProtocolException |
|---|
Sort messages in the folder according to the specified sort criteria. If the search term is not null, limit the sort to only the messages that match the search term. Returns an array of sorted sequence numbers. An empty array is returned if no matches are found.
| term | Sort criteria |
|---|---|
| sterm | SearchTerm |
| ProtocolException | |
|---|---|
| SearchException |
Return a buffer to read a response into. The buffer is provided by fetchBody and is used only once.
Parse the capabilities from a CAPABILITY response or from a CAPABILITY response code attached to (e.g.) an OK response.
| r |
|---|
Check the greeting when first connecting; look for PREAUTH response.
| r |
|---|
| ProtocolException |
|---|
If the response contains a CAPABILITY response code, extract it and save the capabilities.
| r |
|---|
Returns whether this Protocol supports non-synchronizing literals.