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:
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, long uid, Date internalDate, javax.mail.Flags flags, long contentOctets, int bodyStartOctet, List<JPAHeader> headers, PropertyBuilder propertyBuilder)
           
AbstractJPAMessage(JPAMailbox mailbox, long uid, 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()
           
 List<Header> getHeaders()
           
 Date getInternalDate()
           
 JPAMailbox getMailbox()
          Utility getter on Mailbox.
 Long getMailboxId()
           
 String getMediaType()
          Gets the top level MIME content media type.
 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 setUid(long uid)
           
 String toString()
           
 
Methods inherited from class org.apache.james.mailbox.store.mail.model.AbstractMessage
compareTo, createFlags, getBodyOctets
 
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, getFullContent
 

Constructor Detail

AbstractJPAMessage

@Deprecated
public AbstractJPAMessage()
Deprecated. 


AbstractJPAMessage

public AbstractJPAMessage(JPAMailbox mailbox,
                          long uid,
                          Date internalDate,
                          javax.mail.Flags flags,
                          long contentOctets,
                          int bodyStartOctet,
                          List<JPAHeader> headers,
                          PropertyBuilder propertyBuilder)

AbstractJPAMessage

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

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

getHeaders

public List<Header> getHeaders()
See Also:
Message.getHeaders()

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

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

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()

getBodyStartOctet

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

getInternalDate

public Date getInternalDate()
See Also:
MailboxMembership

getMailboxId

public Long getMailboxId()
See Also:
MailboxMembership

getUid

public long getUid()
See Also:
MailboxMembership

isAnswered

public boolean isAnswered()
See Also:
MailboxMembership

isDeleted

public boolean isDeleted()
See Also:
MailboxMembership

isDraft

public boolean isDraft()
See Also:
MailboxMembership

isFlagged

public boolean isFlagged()
See Also:
MailboxMembership

isRecent

public boolean isRecent()
See Also:
MailboxMembership

isSeen

public boolean isSeen()
See Also:
MailboxMembership

setUid

public void setUid(long uid)

setFlags

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

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-2011 The Apache Software Foundation. All Rights Reserved.