com.openexchange.mail.mime
Class ExtendedMimeMessage

java.lang.Object
  extended by javax.mail.Message
      extended by javax.mail.internet.MimeMessage
          extended by com.openexchange.mail.mime.ExtendedMimeMessage
All Implemented Interfaces:
javax.mail.internet.MimePart, javax.mail.Part

public final class ExtendedMimeMessage
extends javax.mail.internet.MimeMessage

ExtendedMimeMessage - Extends MimeMessage by some additional attributes to store message information such as its UID.

Author:
Thorben Betten

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.mail.internet.MimeMessage
javax.mail.internet.MimeMessage.RecipientType
 
Field Summary
 
Fields inherited from interface javax.mail.Part
ATTACHMENT, INLINE
 
Constructor Summary
ExtendedMimeMessage(java.lang.String fullname, char separator, int msgnum)
          Initializes a new ExtendedMimeMessage
 
Method Summary
 com.sun.mail.imap.protocol.BODYSTRUCTURE getBodystructure()
          Gets the body structure.
 java.lang.String getContentType()
           
 java.lang.String getFullname()
          Gets this message's folder fullname
 int getPriority()
          Gets the priority
 java.util.Date getReceivedDate()
           
 char getSeparator()
          Gets this message's folder separator
 int getSize()
           
 int getThreadLevel()
          Gets the thread level
 long getUid()
          Gets the UID
 boolean hasAttachment()
          The flag if this message has attachments
 void parseStream(java.io.InputStream in)
          Parse the input stream: setting the headers and content fields appropriately.
 void setBodystructure(com.sun.mail.imap.protocol.BODYSTRUCTURE bodystructure)
          Sets the body structure.
 void setContentType(ContentType contentType)
          Sets the content type
 void setHasAttachment(boolean hasAttachment)
          Sets the flag if this message has attachments
 void setPriority(int priority)
          Sets the priority
 void setReceivedDate(java.util.Date receivedDate)
          Sets the received date
 void setSize(int size)
          Sets the size
 void setThreadLevel(int threadLevel)
          Sets the thread level
 void setUid(long uid)
          Sets the UID
 
Methods inherited from class javax.mail.internet.MimeMessage
addFrom, addHeader, addHeaderLine, addRecipients, addRecipients, getAllHeaderLines, getAllHeaders, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getHeader, getHeader, getInputStream, getLineCount, getMatchingHeaderLines, getMatchingHeaders, getMessageID, getNonMatchingHeaderLines, getNonMatchingHeaders, getRawInputStream, getRecipients, getReplyTo, getSender, getSentDate, getSubject, isMimeType, isSet, removeHeader, reply, saveChanges, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFlags, setFrom, setFrom, setHeader, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, writeTo, writeTo
 
Methods inherited from class javax.mail.Message
addRecipient, getFolder, getMessageNumber, isExpunged, match, setFlag, setRecipient
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExtendedMimeMessage

public ExtendedMimeMessage(java.lang.String fullname,
                           char separator,
                           int msgnum)
Initializes a new ExtendedMimeMessage

Parameters:
fullname - The folder fullname
separator - The folder separator character
msgnum - The message number in folder
Method Detail

parseStream

public void parseStream(java.io.InputStream in)
                 throws javax.mail.MessagingException
Parse the input stream: setting the headers and content fields appropriately.

Parameters:
in - The input stream
Throws:
javax.mail.MessagingException - If parsing the input stream fails

getFullname

public java.lang.String getFullname()
Gets this message's folder fullname

Returns:
The fullname

getSeparator

public char getSeparator()
Gets this message's folder separator

Returns:
The separator

hasAttachment

public boolean hasAttachment()
The flag if this message has attachments

Returns:
true if this message has attachments; otherwise false

setHasAttachment

public void setHasAttachment(boolean hasAttachment)
Sets the flag if this message has attachments

Parameters:
hasAttachment - true to mark this message to hold attachments; otherwise false

getThreadLevel

public int getThreadLevel()
Gets the thread level

Returns:
the thread level

setThreadLevel

public void setThreadLevel(int threadLevel)
Sets the thread level

Parameters:
threadLevel - the thread level to set

getBodystructure

public com.sun.mail.imap.protocol.BODYSTRUCTURE getBodystructure()
Gets the body structure.

This attribute is only available if underlying mail system as an IMAP server and fetch item BODYSTRUCTURE has been requested.

By now this attribute is only used to detect if message contains (file) attachment(s) in a more precise manner.

Returns:
The body structure

setBodystructure

public void setBodystructure(com.sun.mail.imap.protocol.BODYSTRUCTURE bodystructure)
Sets the body structure.

This attribute can only be set if underlying mail system as an IMAP server and fetch item BODYSTRUCTURE has been requested.

By now this attribute is only used to detect if message contains (file) attachment(s) in a more precise manner.

Parameters:
bodystructure - The body structure to set

getPriority

public int getPriority()
Gets the priority

Returns:
The priority

setPriority

public void setPriority(int priority)
Sets the priority

Parameters:
priority - The priority to set

getReceivedDate

public java.util.Date getReceivedDate()
Overrides:
getReceivedDate in class javax.mail.internet.MimeMessage

setReceivedDate

public void setReceivedDate(java.util.Date receivedDate)
Sets the received date

Parameters:
receivedDate - the received date to set

getSize

public int getSize()
Specified by:
getSize in interface javax.mail.Part
Overrides:
getSize in class javax.mail.internet.MimeMessage

setSize

public void setSize(int size)
Sets the size

Parameters:
size - the size to set

getContentType

public java.lang.String getContentType()
Specified by:
getContentType in interface javax.mail.Part
Overrides:
getContentType in class javax.mail.internet.MimeMessage

setContentType

public void setContentType(ContentType contentType)
Sets the content type

Parameters:
contentType - the content type to set

getUid

public long getUid()
Gets the UID

Returns:
The UID

setUid

public void setUid(long uid)
Sets the UID

Parameters:
uid - The UID to set