| com.google.code.javax.mail.UIDFolder |
Known Indirect Subclasses
|
The UIDFolder interface is implemented by Folders
that can support the "disconnected" mode of operation, by providing
unique-ids for messages in the folder. This interface is based on
the IMAP model for supporting disconnected operation.
A Unique identifier (UID) is a positive long value, assigned to each message in a specific folder. Unique identifiers are assigned in a strictly ascending fashion in the mailbox. That is, as each message is added to the mailbox it is assigned a higher UID than the message(s) which were added previously. Unique identifiers persist across sessions. This permits a client to resynchronize its state from a previous session with the server.
Associated with every mailbox is a unique identifier validity value. If unique identifiers from an earlier session fail to persist to this session, the unique identifier validity value must be greater than the one used in the earlier session.
Refer to RFC 2060 http://www.ietf.org/rfc/rfc2060.txt for more information.
| Nested Classes | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| UIDFolder.FetchProfileItem | A fetch profile item for fetching UIDs. | ||||||||||
| Constants | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| long | LASTUID | This is a special value that can be used as the end
parameter in getMessagesByUID(start, end), to denote the
UID of the last message in the folder. |
|||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
Get the Message corresponding to the given UID.
| |||||||||||
Get the Messages specified by the given array of UIDs.
| |||||||||||
Get the Messages specified by the given range.
| |||||||||||
Get the UID for the specified message.
| |||||||||||
Returns the UIDValidity value associated with this folder.
| |||||||||||
This is a special value that can be used as the end
parameter in getMessagesByUID(start, end), to denote the
UID of the last message in the folder.
Get the Message corresponding to the given UID. If no such
message exists, null is returned.
| uid | UID for the desired message |
|---|
null is returned
if no message corresponding to this UID is obtained.| MessagingException |
|---|
Get the Messages specified by the given array of UIDs. If any UID is
invalid, null is returned for that entry.
Note that the returned array will be of the same size as the specified
array of UIDs, and null entries may be present in the
array to indicate invalid UIDs.
| uids | Array of UIDs |
|---|
| MessagingException |
|---|
Get the Messages specified by the given range. The special
value LASTUID can be used for the end parameter
to indicate the UID of the last message in the folder.
Note that end need not be greater than start;
the order of the range doesn't matter.
Note also that, unless the folder is empty, use of LASTUID ensures
that at least one message will be returned - the last message in the
folder.
| start | Start UID |
|---|---|
| end | End UID |
| MessagingException |
|---|
Get the UID for the specified message. Note that the message must belong to this folder. Otherwise java.util.NoSuchElementException is thrown.
| message | Message from this folder |
|---|
| NoSuchElementException | if the given Message is not in this GmailFolder. |
|---|---|
| MessagingException |
Returns the UIDValidity value associated with this folder.
Clients typically compare this value against a UIDValidity value saved from a previous session to insure that any cached UIDs are not stale.
| MessagingException |
|---|