|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface MessageResult
Used to get specific informations about a Message without dealing with a MimeMessage instance. Demanded information can be requested by binary combining the constants.
I came to the Idea of the MessageResult because there are many possible combinations of different requests (uid, msn, MimeMessage, Flags).
e.g. I want to have all uids, msns and flags of all messages. (a common IMAP operation) Javamail would do it that way:
This means creating a lazy-loading MimeMessage instance. So why don't call getMessages(MessageResult.UID | MessageResult.MSN | MessageResult.FLAGS)? This would leave a lot of room for the implementation to optimize
Nested Class Summary | |
---|---|
static interface |
MessageResult.Content
IMAP needs to know the size of the content before it starts to write it out. |
static interface |
MessageResult.FetchGroup
Indicates the results fetched. |
static interface |
MessageResult.Header
A header. |
static interface |
MessageResult.MimeDescriptor
|
static interface |
MessageResult.MimePath
Describes a path within a multipart MIME message. |
Method Summary | |
---|---|
MessageResult.Content |
getBody()
Gets the body of the message excluding headers. |
MessageResult.Content |
getBody(MessageResult.MimePath path)
Gets the body of the given mime part. |
javax.mail.Flags |
getFlags()
TODO optional, to be decided maybe this is a good thing because IMAP often requests only the Flags and this way we don't need to create a lazy-loading MimeMessage instance just for the Flags. |
MessageResult.Content |
getFullContent()
Gets the full message including headers and body. |
MessageResult.Content |
getFullContent(MessageResult.MimePath path)
Gets the full content of the given mime part. |
MessageResult.FetchGroup |
getIncludedResults()
Gets the results set. |
java.util.Date |
getInternalDate()
IMAP defines this as the time when the message has arrived to the server (by smtp). |
MessageResult.Content |
getMimeBody(MessageResult.MimePath path)
Gets the body of the given mime part. |
MessageResult.MimeDescriptor |
getMimeDescriptor()
|
int |
getSize()
|
long |
getUid()
|
long |
getUidValidity()
|
java.util.Iterator |
headers()
Gets headers for the message. |
java.util.Iterator |
iterateHeaders(MessageResult.MimePath path)
Iterates the message headers for the given part in a multipart message. |
java.util.Iterator |
iterateMimeHeaders(MessageResult.MimePath path)
Iterates the MIME headers for the given part in a multipart message. |
Methods inherited from interface java.lang.Comparable |
---|
compareTo |
Method Detail |
---|
MessageResult.FetchGroup getIncludedResults()
MessageResultUtils.isIncluded(MessageResult, int)
MessageResult.MimeDescriptor getMimeDescriptor() throws MailboxManagerException
MailboxManagerException
long getUid()
long getUidValidity()
java.util.Date getInternalDate()
IMAP defines this as the time when the message has arrived to the server (by smtp). Clients are also allowed to set the internalDate on apppend.
Is this Mail.getLastUpdates() for James delivery? Should we use MimeMessage.getReceivedDate()?
javax.mail.Flags getFlags() throws MailboxManagerException
MailboxManagerException
int getSize()
java.util.Iterator headers() throws MailboxManagerException
headers
in interface Headers
Header
Iterator
, or null if
MessageResult.FetchGroup.HEADERS
was not fetched
MailboxManagerException
java.util.Iterator iterateHeaders(MessageResult.MimePath path) throws MailboxManagerException
path
- describing the part's position within a multipart message
Header
Iterator
, or null when
FetchGroup#mimeHeaders()
does not include the index and
when the mime part cannot be found
MailboxManagerException
java.util.Iterator iterateMimeHeaders(MessageResult.MimePath path) throws MailboxManagerException
path
- describing the part's position within a multipart message
Header
Iterator
, or null when
FetchGroup#mimeHeaders()
does not include the index and
when the mime part cannot be found
MailboxManagerException
MessageResult.Content getFullContent() throws MailboxManagerException
Content
, or or null if
MessageResult.FetchGroup.FULL_CONTENT
has not been included in the
results
MailboxManagerException
MessageResult.Content getFullContent(MessageResult.MimePath path) throws MailboxManagerException
path
- describes the part
Content
, or null when
FetchGroup#mimeBodies()
did not been include the given
index and when the mime part cannot be found
MailboxManagerException
MessageResult.Content getBody() throws MailboxManagerException
Content
, or or null if
MessageResult.FetchGroup.FULL_CONTENT
has not been included in the
results
MailboxManagerException
MessageResult.Content getBody(MessageResult.MimePath path) throws MailboxManagerException
path
- describes the part
Content
, or null when
FetchGroup#mimeBodies()
did not been include the given
index and when the mime part cannot be found
MailboxManagerException
MessageResult.Content getMimeBody(MessageResult.MimePath path) throws MailboxManagerException
path
- describes the part
Content
, or null when
FetchGroup#mimeBodies()
did not been include the given
index and when the mime part cannot be found
MailboxManagerException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |