org.apache.james.mailbox.jpa.mail.model.openjpa
Class AbstractJPAMessage

java.lang.Object
  extended by org.apache.james.mailbox.store.mail.model.AbstractMessage<Long>
      extended by org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage
All Implemented Interfaces:
Comparable<Message<Long>>, Message<Long>
Direct Known Subclasses:
JPAEncryptedMessage, JPAMessage, JPAStreamingMessage

@MappedSuperclass
public abstract class AbstractJPAMessage
extends AbstractMessage<Long>

Abstract base class for JPA based implementations of AbstractMessage


Nested Class Summary
static class AbstractJPAMessage.MailboxIdUidKey
          Identifies composite key
 
Constructor Summary
AbstractJPAMessage()
          Deprecated. 
AbstractJPAMessage(JPAMailbox mailbox, Date internalDate, javax.mail.Flags flags, long contentOctets, int bodyStartOctet, PropertyBuilder propertyBuilder)
           
AbstractJPAMessage(JPAMailbox mailbox, long uid, long modSeq, Message<?> original)
          Constructs a copy of the given message.
 
Method Summary
protected  String[] createUserFlags()
          This implementation supports user flags
 boolean equals(Object obj)
           
protected  int getBodyStartOctet()
           
 long getFullContentOctets()
           
 Date getInternalDate()
           
 JPAMailbox getMailbox()
          Utility getter on Mailbox.
 Long getMailboxId()
           
 String getMediaType()
          Gets the top level MIME content media type.
 long getModSeq()
           
 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()
           
 int hashCode()
           
 boolean isAnswered()
           
 boolean isDeleted()
           
 boolean isDraft()
           
 boolean isFlagged()
           
 boolean isRecent()
           
 boolean isSeen()
           
 void setFlags(javax.mail.Flags flags)
           
 void setMailbox(JPAMailbox mailbox)
          Utility setter on Mailbox.
 void setModSeq(long modSeq)
           
 void setUid(long uid)
           
 String toString()
           
 
Methods inherited from class org.apache.james.mailbox.store.mail.model.AbstractMessage
compareTo, createFlags, getBodyOctets, getFullContent
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.james.mailbox.store.mail.model.Message
getBodyContent, getHeaderContent
 

Constructor Detail

AbstractJPAMessage

@Deprecated
public AbstractJPAMessage()
Deprecated. 


AbstractJPAMessage

public AbstractJPAMessage(JPAMailbox mailbox,
                          Date internalDate,
                          javax.mail.Flags flags,
                          long contentOctets,
                          int bodyStartOctet,
                          PropertyBuilder propertyBuilder)

AbstractJPAMessage

public AbstractJPAMessage(JPAMailbox mailbox,
                          long uid,
                          long modSeq,
                          Message<?> original)
                   throws MailboxException
Constructs a copy of the given message. All properties are cloned except mailbox and UID.

Parameters:
mailbox - new mailbox
uid - new UID
modSeq - new modSeq
original - message to be copied, not null
Throws:
IOException
MailboxException
Method Detail

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

getModSeq

public long getModSeq()
See Also:
Message.getModSeq()

setModSeq

public void setModSeq(long modSeq)
See Also:
Message.setModSeq(long)

getMediaType

public String getMediaType()
Gets the top level MIME content media type.

Returns:
top level MIME content media type, or null if default

getSubType

public String getSubType()
Gets the MIME content subtype.

Returns:
the MIME content subtype, or null if default

getProperties

public List<Property> getProperties()
Gets a read-only list of meta-data properties. For properties with multiple values, this list will contain several enteries with the same namespace and local name.

Returns:
unmodifiable list of meta-data, not null

getTextualLineCount

public Long getTextualLineCount()
Gets the number of CRLF in a textual document.

Returns:
CRLF count when document is textual, null otherwise

getFullContentOctets

public long getFullContentOctets()
See Also:
Message.getFullContentOctets()

getBodyStartOctet

protected int getBodyStartOctet()
Specified by:
getBodyStartOctet in class AbstractMessage<Long>

getInternalDate

public Date getInternalDate()
See Also:
Message.getInternalDate()

getMailboxId

public Long getMailboxId()
See Also:
Message.getMailboxId()

getUid

public long getUid()
See Also:
Message.getUid()

isAnswered

public boolean isAnswered()
See Also:
Message.isAnswered()

isDeleted

public boolean isDeleted()
See Also:
Message.isDeleted()

isDraft

public boolean isDraft()
See Also:
Message.isDraft()

isFlagged

public boolean isFlagged()
See Also:
Message.isFlagged()

isRecent

public boolean isRecent()
See Also:
Message.isRecent()

isSeen

public boolean isSeen()
See Also:
Message.isSeen()

setUid

public void setUid(long uid)

setFlags

public void setFlags(javax.mail.Flags flags)
See Also:
Message.setFlags(javax.mail.Flags)

getMailbox

public JPAMailbox getMailbox()
Utility getter on Mailbox.


createUserFlags

protected String[] createUserFlags()
This implementation supports user flags

Overrides:
createUserFlags in class AbstractMessage<Long>

setMailbox

public void setMailbox(JPAMailbox mailbox)
Utility setter on Mailbox.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.