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, getBodyOctets
public 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
- IOException
MailboxException
public long getFullContentOctets()
Message
getFullContentOctets
in interface Message<String>
public String getMediaType()
Message
getMediaType
in interface Message<String>
public List<Property> getProperties()
Message
getProperties
in interface Message<String>
public String getSubType()
Message
getSubType
in interface Message<String>
public Long getTextualLineCount()
Message
getTextualLineCount
in interface Message<String>
public javax.jcr.Node getNode()
Persistent
getNode
in interface Persistent
public boolean isPersistent()
Persistent
isPersistent
in interface Persistent
true
if object is persistent else false
public String getUUID()
public void merge(javax.jcr.Node node) throws javax.jcr.RepositoryException, IOException
Persistent
merge
in interface Persistent
javax.jcr.RepositoryException
IOException
protected String[] createUserFlags()
AbstractMessage
createUserFlags
in class AbstractMessage<String>
protected int getBodyStartOctet()
AbstractMessage
getBodyStartOctet
in class AbstractMessage<String>
public Date getInternalDate()
getInternalDate
in interface Message<String>
public String getMailboxId()
Message
getMailboxId
in interface Message<String>
public long getUid()
Message
public boolean isAnswered()
Message
isAnswered
in interface Message<String>
public boolean isDeleted()
Message
public boolean isDraft()
Message
public boolean isFlagged()
Message
public boolean isRecent()
Message
public boolean isSeen()
Message
public void setFlags(javax.mail.Flags flags)
Message
public void unsetRecent()
public String getId()
public InputStream getFullContent() throws IOException
AbstractMessage
Message.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>
IOException
public InputStream getBodyContent() throws IOException
Message
InputStream
on every call, which basicly means it need to start at position 0getBodyContent
in interface Message<String>
IOException
public long getModSeq()
Message
public void setModSeq(long modSeq)
Message
public void setUid(long uid)
Message
public InputStream getHeaderContent() throws IOException
Message
InputStream
. 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>
IOException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.