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

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
          extended by org.apache.james.mailbox.jpa.mail.model.openjpa.JPAStreamingMessage
All Implemented Interfaces:
Comparable<Message<Long>>, Message<Long>

@Entity(name="Message")
public class JPAStreamingMessage
extends AbstractJPAMessage

JPA implementation of AbstractJPAMessage which use openjpas Persistent type to be able to stream the message content without loading it into the memory at all. This is not supported for all DB's yet. See http://openjpa.apache.org/builds/latest/docs/manual/ref_guide_mapping_jpa.html If your DB is not supported by this, use JPAMessage TODO: Fix me!


Nested Class Summary
 
Nested classes/interfaces inherited from class org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage
AbstractJPAMessage.MailboxIdUidKey
 
Constructor Summary
JPAStreamingMessage()
          Deprecated. 
JPAStreamingMessage(JPAMailbox mailbox, long uid, Date internalDate, int size, javax.mail.Flags flags, InputStream content, int bodyStartOctet, List<JPAHeader> headers, PropertyBuilder propertyBuilder)
           
JPAStreamingMessage(JPAMailbox mailbox, long uid, Message<?> message)
          Create a copy of the given message
 
Method Summary
 InputStream getBodyContent()
           
 InputStream getFullContent()
           
 
Methods inherited from class org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage
createUserFlags, equals, getBodyStartOctet, getFullContentOctets, getHeaders, getInternalDate, getMailbox, getMailboxId, getMediaType, getProperties, getSubType, getTextualLineCount, getUid, hashCode, isAnswered, isDeleted, isDraft, isFlagged, isRecent, isSeen, setFlags, setMailbox, setUid, 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
 

Constructor Detail

JPAStreamingMessage

@Deprecated
public JPAStreamingMessage()
Deprecated. 


JPAStreamingMessage

public JPAStreamingMessage(JPAMailbox mailbox,
                           long uid,
                           Date internalDate,
                           int size,
                           javax.mail.Flags flags,
                           InputStream content,
                           int bodyStartOctet,
                           List<JPAHeader> headers,
                           PropertyBuilder propertyBuilder)
                    throws MailboxException
Throws:
MailboxException

JPAStreamingMessage

public JPAStreamingMessage(JPAMailbox mailbox,
                           long uid,
                           Message<?> message)
                    throws MailboxException
Create a copy of the given message

Parameters:
message -
Throws:
IOException
MailboxException
Method Detail

getFullContent

public InputStream getFullContent()
                           throws IOException
Throws:
IOException

getBodyContent

public InputStream getBodyContent()
                           throws IOException
Throws:
IOException


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