com.sun.mail.imap
Class IMAPNestedMessage

java.lang.Object
  extended by javax.mail.Message
      extended by javax.mail.internet.MimeMessage
          extended by com.sun.mail.imap.IMAPMessage
              extended by com.sun.mail.imap.IMAPNestedMessage
All Implemented Interfaces:
MimePart, Part

public class IMAPNestedMessage
extends IMAPMessage

This class implements a nested IMAP message

Author:
John Mani

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
MimeMessage.RecipientType
 
Field Summary
 
Fields inherited from class com.sun.mail.imap.IMAPMessage
bs, envelope, sectionId
 
Fields inherited from class javax.mail.internet.MimeMessage
content, contentStream, dh, flags, headers, modified, saved
 
Fields inherited from class javax.mail.Message
expunged, folder, msgnum, session
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Method Summary
protected  void checkExpunged()
           
protected  int getFetchBlockSize()
           
protected  java.lang.Object getMessageCacheLock()
          Get the messageCacheLock, associated with this Message's Folder.
protected  IMAPProtocol getProtocol()
          Get this message's folder's protocol connection.
protected  int getSequenceNumber()
          Get this message's IMAP sequence number.
 int getSize()
          Get the message size.
 boolean isExpunged()
          Checks whether this message is expunged.
protected  boolean isREV1()
           
 void setFlags(Flags flag, boolean set)
          Set/Unset the given flags in this message.
 
Methods inherited from class com.sun.mail.imap.IMAPMessage
addFrom, addHeader, addHeaderLine, addRecipients, forceCheckExpunged, getAllHeaderLines, getAllHeaders, getContentID, getContentLanguage, getContentMD5, getContentStream, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInReplyTo, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getPeek, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSubject, getUID, invalidateHeaders, isSet, removeHeader, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDisposition, setExpunged, setFileName, setFrom, setHeader, setMessageNumber, setPeek, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setUID, writeTo
 
Methods inherited from class javax.mail.internet.MimeMessage
addRecipients, createInternetHeaders, createMimeMessage, getAllRecipients, getContent, getInputStream, getRawInputStream, isMimeType, parse, reply, saveChanges, setContent, setContent, setDescription, setFrom, setRecipients, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo
 
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, match, setFlag, setRecipient
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getProtocol

protected IMAPProtocol getProtocol()
                            throws ProtocolException,
                                   FolderClosedException
Description copied from class: IMAPMessage
Get this message's folder's protocol connection. Throws FolderClosedException, if the protocol connection is not available. ASSERT: Must hold the messageCacheLock.

Overrides:
getProtocol in class IMAPMessage
Throws:
ProtocolException
FolderClosedException

isREV1

protected boolean isREV1()
                  throws FolderClosedException
Overrides:
isREV1 in class IMAPMessage
Throws:
FolderClosedException

getMessageCacheLock

protected java.lang.Object getMessageCacheLock()
Description copied from class: IMAPMessage
Get the messageCacheLock, associated with this Message's Folder.

Overrides:
getMessageCacheLock in class IMAPMessage

getSequenceNumber

protected int getSequenceNumber()
Description copied from class: IMAPMessage
Get this message's IMAP sequence number. ASSERT: This method must be called only when holding the messageCacheLock.

Overrides:
getSequenceNumber in class IMAPMessage

checkExpunged

protected void checkExpunged()
                      throws MessageRemovedException
Overrides:
checkExpunged in class IMAPMessage
Throws:
MessageRemovedException

isExpunged

public boolean isExpunged()
Description copied from class: Message
Checks whether this message is expunged. All other methods except getMessageNumber() are invalid on an expunged Message object.

Messages that are expunged due to an explict expunge() request on the containing Folder are removed from the Folder immediately. Messages that are externally expunged by another source are marked "expunged" and return true for the isExpunged() method, but they are not removed from the Folder until an explicit expunge() is done on the Folder.

See the description of expunge() for more details on expunge handling.

Overrides:
isExpunged in class Message
See Also:
Folder.expunge()

getFetchBlockSize

protected int getFetchBlockSize()
Overrides:
getFetchBlockSize in class IMAPMessage

getSize

public int getSize()
            throws MessagingException
Description copied from class: IMAPMessage
Get the message size.

Note that this returns RFC822.SIZE. That is, it's the size of the whole message, header and body included.

Specified by:
getSize in interface Part
Overrides:
getSize in class IMAPMessage
Returns:
size of content in bytes
Throws:
MessagingException

setFlags

public void setFlags(Flags flag,
                     boolean set)
              throws MessagingException
Description copied from class: IMAPMessage
Set/Unset the given flags in this message.

Overrides:
setFlags in class IMAPMessage
Parameters:
flag - Flags object containing the flags to be set
set - the value to be set
Throws:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values.
See Also:
MessageChangedEvent


Copyright © 2010 Sun Microsystems, Inc.. All Rights Reserved.