public class JCRMessage extends AbstractMessage<String> implements JCRImapConstants, Persistent
Message| Modifier and Type | Field and Description |
|---|---|
static String |
ANSWERED_PROPERTY |
static String |
BODY_START_OCTET_PROPERTY |
static String |
DELETED_PROPERTY |
static String |
DRAFT_PROPERTY |
static String |
FLAGGED_PROPERTY |
static String |
HEADER_NODE_TYPE |
static String |
INTERNAL_DATE_PROPERTY |
static String |
MAILBOX_UUID_PROPERTY |
static String |
MODSEQ_PROPERTY |
static String |
PROPERTY_NODE_TYPE |
static String |
RECENT_PROPERTY |
static String |
SEEN_PROPERTY |
static String |
SIZE_PROPERTY |
static String |
SUBTYPE_PROPERTY |
static String |
TEXTUAL_LINE_COUNT_PROPERTY |
static String |
UID_PROPERTY |
static String |
USERFLAGS_PROPERTY |
NODE_DELIMITER| Constructor and Description |
|---|
JCRMessage(javax.jcr.Node node,
org.slf4j.Logger logger) |
JCRMessage(String mailboxUUID,
Date internalDate,
int size,
javax.mail.Flags flags,
javax.mail.internet.SharedInputStream content,
int bodyStartOctet,
PropertyBuilder propertyBuilder,
org.slf4j.Logger logger) |
JCRMessage(String mailboxUUID,
long uid,
long modSeq,
JCRMessage message,
org.slf4j.Logger logger)
Create a copy of the given message
|
| Modifier and Type | Method and Description |
|---|---|
protected String[] |
createUserFlags()
Return all stored user flags or null if none are stored.
|
boolean |
equals(Object obj) |
InputStream |
getBodyContent()
Gets the body content of the document.
|
protected int |
getBodyStartOctet()
Return the start octet of the body
|
InputStream |
getFullContent()
This implementation just concat
Message.getHeaderContent() and Message.getBodyContent(). |
long |
getFullContentOctets()
The number of octets contained in the full content of this document.
|
InputStream |
getHeaderContent()
Gets the header as
InputStream. |
String |
getId() |
Date |
getInternalDate() |
String |
getMailboxId()
Return the mailbox id of the linked mailbox
|
String |
getMediaType()
Gets the top level MIME content media type.
|
long |
getModSeq()
Return the mod-sequence for the message
|
javax.jcr.Node |
getNode()
Return underlying Node
|
List<Property> |
getProperties()
Gets a read-only list of meta-data properties.
|
String |
getSubType()
Gets the MIME content subtype.
|
Long |
getTextualLineCount()
Gets the number of CRLF in a textual document.
|
long |
getUid()
Return the uid
|
String |
getUUID() |
int |
hashCode() |
boolean |
isAnswered()
Return if it was marked as answered
|
boolean |
isDeleted()
Return if it was mark as deleted
|
boolean |
isDraft()
Return if it was mark as draft
|
boolean |
isFlagged()
Return if it was flagged
|
boolean |
isPersistent()
Return if the object is persistent
|
boolean |
isRecent()
Return if it was marked as recent
|
boolean |
isSeen()
Return if it was marked as seen
|
void |
merge(javax.jcr.Node node)
Merge the object with the node
|
void |
setFlags(javax.mail.Flags flags)
Set the Flags
|
void |
setModSeq(long modSeq)
Set the mod-sequence for the message.
|
void |
setUid(long uid)
Set the uid for the message.
|
String |
toString() |
void |
unsetRecent() |
compareTo, createFlags, getBodyOctetspublic static final String MAILBOX_UUID_PROPERTY
public static final String UID_PROPERTY
public static final String SIZE_PROPERTY
public static final String ANSWERED_PROPERTY
public static final String DELETED_PROPERTY
public static final String DRAFT_PROPERTY
public static final String FLAGGED_PROPERTY
public static final String USERFLAGS_PROPERTY
public static final String RECENT_PROPERTY
public static final String SEEN_PROPERTY
public static final String INTERNAL_DATE_PROPERTY
public static final String BODY_START_OCTET_PROPERTY
public static final String HEADER_NODE_TYPE
public static final String PROPERTY_NODE_TYPE
public static final String TEXTUAL_LINE_COUNT_PROPERTY
public static final String SUBTYPE_PROPERTY
public static final String MODSEQ_PROPERTY
public JCRMessage(javax.jcr.Node node,
org.slf4j.Logger logger)
public JCRMessage(String mailboxUUID, Date internalDate, int size, javax.mail.Flags flags, javax.mail.internet.SharedInputStream content, int bodyStartOctet, PropertyBuilder propertyBuilder, org.slf4j.Logger logger)
public JCRMessage(String mailboxUUID, long uid, long modSeq, JCRMessage message, org.slf4j.Logger logger) throws MailboxException
message - IOExceptionMailboxExceptionpublic long getFullContentOctets()
MessagegetFullContentOctets in interface Message<String>public String getMediaType()
MessagegetMediaType in interface Message<String>public List<Property> getProperties()
MessagegetProperties in interface Message<String>public String getSubType()
MessagegetSubType in interface Message<String>public Long getTextualLineCount()
MessagegetTextualLineCount in interface Message<String>public javax.jcr.Node getNode()
PersistentgetNode in interface Persistentpublic boolean isPersistent()
PersistentisPersistent in interface Persistenttrue if object is persistent else falsepublic String getUUID()
public void merge(javax.jcr.Node node)
throws javax.jcr.RepositoryException,
IOException
Persistentmerge in interface Persistentjavax.jcr.RepositoryExceptionIOExceptionprotected String[] createUserFlags()
AbstractMessagecreateUserFlags in class AbstractMessage<String>protected int getBodyStartOctet()
AbstractMessagegetBodyStartOctet in class AbstractMessage<String>public Date getInternalDate()
getInternalDate in interface Message<String>public String getMailboxId()
MessagegetMailboxId in interface Message<String>public long getUid()
Messagepublic boolean isAnswered()
MessageisAnswered in interface Message<String>public boolean isDeleted()
Messagepublic boolean isDraft()
Messagepublic boolean isFlagged()
Messagepublic boolean isRecent()
Messagepublic boolean isSeen()
Messagepublic void setFlags(javax.mail.Flags flags)
Messagepublic void unsetRecent()
public String getId()
public InputStream getFullContent() throws IOException
AbstractMessageMessage.getHeaderContent() and Message.getBodyContent().
Implementation should override this if they can provide a more performant solutiongetFullContent in interface Message<String>getFullContent in class AbstractMessage<String>IOExceptionpublic InputStream getBodyContent() throws IOException
MessageInputStream
on every call, which basicly means it need to start at position 0getBodyContent in interface Message<String>IOExceptionpublic long getModSeq()
Messagepublic void setModSeq(long modSeq)
Messagepublic void setUid(long uid)
Messagepublic InputStream getHeaderContent() throws IOException
MessageInputStream. This MUST INCLUDE the CRLF terminator
Be aware that this method need to return a new fresh InputStream
on every callgetHeaderContent in interface Message<String>IOExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.