This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.mail
interface UIDFolder

All Known Implementing Classes:
IMAPFolder, DefaultFolder

Most common way to construct:

UIDFolder uidFolder = (UIDFolder)aFolder;

Based on 33 examples


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.

See Also (auto-generated):

Session

Message

Properties


Nested Class Summary
static class

           A fetch profile item for fetching UIDs.
 
Field Summary
static 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.
 
Method Summary
 Message
getMessageByUID(long uid)

          Get the Message corresponding to the given UID.
 Message[]
getMessagesByUID(long start, long end)

          Get the Messages specified by the given range.
 Message[]
getMessagesByUID(long[] uids)

          Get the Messages specified by the given array of UIDs.
 long
getUID(Message message)

          Get the UID for the specified message.
 long

          Returns the UIDValidity value associated with this folder.
 

Field Detail

LASTUID

public static final 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.
Method Detail

getMessageByUID

public Message getMessageByUID(long uid)
                        throws MessagingException
Get the Message corresponding to the given UID. If no such message exists, null is returned.

Parameters:
uid - UID for the desired message
Returns:
the Message object. null is returned if no message corresponding to this UID is obtained.
Throws:
MessagingException

getMessagesByUID

public Message[] getMessagesByUID(long start,
                                  long end)
                           throws 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.

Parameters:
start - start UID
end - end UID
Returns:
array of Message objects
Throws:
MessagingException

getMessagesByUID

public Message[] getMessagesByUID(long[] uids)
                           throws 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.

Parameters:
uids - array of UIDs
Returns:
array of Message objects
Throws:
MessagingException

getUID

public long getUID(Message message)
            throws MessagingException
Get the UID for the specified message. Note that the message must belong to this folder. Otherwise java.util.NoSuchElementException is thrown.

Parameters:
message - Message from this folder
Returns:
UID for this message
Throws:
MessagingException

getUIDValidity

public long getUIDValidity()
                    throws 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.

Returns:
UIDValidity
Throws:
MessagingException


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.