|
||||||||||
| 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.FetchGroup
Indicates the results fetched. |
static interface |
MessageResult.Header
A header. |
static interface |
MessageResult.MimePath
Describes a path within a multipart MIME message. |
| Method Summary | |
|---|---|
Content |
getBody()
Gets the body of the message excluding headers. |
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. |
Content |
getFullContent()
Gets the full message including headers and body. |
Content |
getFullContent(MessageResult.MimePath path)
Gets the full content of the given mime part. |
java.util.Date |
getInternalDate()
IMAP defines this as the time when the message has arrived to the server (by smtp). |
Content |
getMimeBody(MessageResult.MimePath path)
Gets the body of the given mime part. |
MimeDescriptor |
getMimeDescriptor()
|
long |
getSize()
Return the size in bytes |
long |
getUid()
Return the uid of the message which the MessageResult belongs to |
java.util.Iterator<MessageResult.Header> |
iterateHeaders(MessageResult.MimePath path)
Iterates the message headers for the given part in a multipart message. |
java.util.Iterator<MessageResult.Header> |
iterateMimeHeaders(MessageResult.MimePath path)
Iterates the MIME headers for the given part in a multipart message. |
| Methods inherited from interface java.lang.Comparable |
|---|
compareTo |
| Methods inherited from interface org.apache.james.mailbox.Headers |
|---|
headers |
| Method Detail |
|---|
MimeDescriptor getMimeDescriptor()
throws MailboxException
MailboxExceptionlong getUid()
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 MailboxException
MailboxExceptionlong getSize()
java.util.Iterator<MessageResult.Header> iterateHeaders(MessageResult.MimePath path)
throws MailboxException
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
MailboxException
java.util.Iterator<MessageResult.Header> iterateMimeHeaders(MessageResult.MimePath path)
throws MailboxException
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
MailboxException
Content getFullContent()
throws MailboxException
Content, or or null if
MessageResult.FetchGroup.FULL_CONTENT has not been included in the
results
MailboxException
Content getFullContent(MessageResult.MimePath path)
throws MailboxException
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
MailboxException
Content getBody()
throws MailboxException
Content, or or null if
MessageResult.FetchGroup.FULL_CONTENT has not been included in the
results
MailboxException
Content getBody(MessageResult.MimePath path)
throws MailboxException
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
MailboxException
Content getMimeBody(MessageResult.MimePath path)
throws MailboxException
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
MailboxException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||