| 
 | Java EE 5 SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface UIDFolder
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 Class Summary | |
|---|---|
| static class | UIDFolder.FetchProfileItemA fetch profile item for fetching UIDs. | 
| Field Summary | |
|---|---|
| static long | LASTUIDThis is a special value that can be used as the endparameter ingetMessagesByUID(start, end), to denote the
 UID of the last message in the folder. | 
| Method Summary | |
|---|---|
|  Message | getMessageByUID(long uid)Get the Message corresponding to the given UID. | 
|  Message[] | getMessagesByUID(long[] uids)Get the Messages specified by the given array of UIDs. | 
|  Message[] | getMessagesByUID(long start,
 long end)Get the Messages specified by the given range. | 
|  long | getUID(Message message)Get the UID for the specified message. | 
|  long | getUIDValidity()Returns the UIDValidity value associated with this folder. | 
| Field Detail | 
|---|
static final long LASTUID
end
 parameter in getMessagesByUID(start, end), to denote the
 UID of the last message in the folder.
| Method Detail | 
|---|
long getUIDValidity() throws MessagingException
Clients typically compare this value against a UIDValidity value saved from a previous session to insure that any cached UIDs are not stale.
MessagingExceptionMessage getMessageByUID(long uid) throws MessagingException
null is returned.
uid - UID for the desired message
null is returned
 if no message corresponding to this UID is obtained.
MessagingExceptionMessage[] getMessagesByUID(long start, long end) throws MessagingException
end parameter
 to indicate the UID of the last message in the folder.
start - start UIDend - end UID
MessagingExceptionLASTUIDMessage[] getMessagesByUID(long[] uids) throws MessagingException
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
MessagingExceptionlong getUID(Message message) throws MessagingException
message - Message from this folder
NoSuchElementException - if the given Message
 is not in this Folder.
MessagingException| 
 | Java EE 5 SDK | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
Scripting on this page tracks web page traffic, but does not change the content in any way.