javax.mail
Interface UIDFolder


public interface UIDFolder

Version:
$Rev: 582797 $ $Date: 2007-10-08 08:29:12 -0400 (Mon, 08 Oct 2007) $

Nested Class Summary
static class UIDFolder.FetchProfileItem
          Special profile item used for fetching UID information.
 
Field Summary
static long LASTUID
          A special value than can be passed as the end parameter to Folder.getMessages(int, int) to indicate the last message in this folder.
 
Method Summary
 Message getMessageByUID(long uid)
          Retrieve a message using the UID rather than the message sequence number.
 Message[] getMessagesByUID(long[] ids)
          Retrieve a set of messages by explicit UIDs.
 Message[] getMessagesByUID(long start, long end)
          Get a series of messages using a UID range.
 long getUID(Message message)
          Retrieve the UID for a message from this Folder.
 long getUIDValidity()
          Get the UID validity value for this Folder.
 

Field Detail

LASTUID

static final long LASTUID
A special value than can be passed as the end parameter to Folder.getMessages(int, int) to indicate the last message in this folder.

See Also:
Constant Field Values
Method Detail

getUIDValidity

long getUIDValidity()
                    throws MessagingException
Get the UID validity value for this Folder.

Returns:
The current UID validity value, as a long.
Throws:
MessagingException

getMessageByUID

Message getMessageByUID(long uid)
                        throws MessagingException
Retrieve a message using the UID rather than the message sequence number. Returns null if the message doesn't exist.

Parameters:
uid - The target UID.
Returns:
the Message object. Returns null if the message does not exist.
Throws:
MessagingException

getMessagesByUID

Message[] getMessagesByUID(long start,
                           long end)
                           throws MessagingException
Get a series of messages using a UID range. The special value LASTUID can be used to mark the last available message.

Parameters:
start - The start of the UID range.
end - The end of the UID range. The special value LASTUID can be used to request all messages up to the last UID.
Returns:
An array containing all of the messages in the range.
Throws:
MessagingException

getMessagesByUID

Message[] getMessagesByUID(long[] ids)
                           throws MessagingException
Retrieve a set of messages by explicit UIDs. If any message in the list does not exist, null will be returned for the corresponding item.

Parameters:
ids - An array of UID values to be retrieved.
Returns:
An array of Message items the same size as the ids argument array. This array will contain null entries for any UIDs that do not exist.
Throws:
MessagingException

getUID

long getUID(Message message)
            throws MessagingException
Retrieve the UID for a message from this Folder. The argument Message MUST belong to this Folder instance, otherwise a NoSuchElementException will be thrown.

Parameters:
message - The target message.
Returns:
The UID associated with this message.
Throws:
MessagingException


Copyright © 2003-2009 The Apache Software Foundation. All Rights Reserved.