Id - public abstract class AbstractMessageMapper<Id> extends TransactionalMapper implements MessageMapper<Id>
MessageMapper implementation which already takes care of most uid / mod-seq handlingMessageMapper.FetchTypeMapper.Transaction<T>, Mapper.VoidTransaction| Modifier and Type | Field and Description |
|---|---|
protected MailboxSession |
mailboxSession |
| Constructor and Description |
|---|
AbstractMessageMapper(MailboxSession mailboxSession,
UidProvider<Id> uidProvider,
ModSeqProvider<Id> modSeqProvider) |
| Modifier and Type | Method and Description |
|---|---|
MessageMetaData |
add(Mailbox<Id> mailbox,
Message<Id> message)
Add the given
Message to the underlying storage. |
protected abstract MessageMetaData |
copy(Mailbox<Id> mailbox,
long uid,
long modSeq,
Message<Id> original)
Copy the Message to the Mailbox, using the given uid and modSeq for the new Message
|
MessageMetaData |
copy(Mailbox<Id> mailbox,
Message<Id> original)
Copy the given
Message to a new mailbox and return the uid of the copy. |
long |
getHighestModSeq(Mailbox<Id> mailbox)
Return the higest mod-sequence which were used for storing a Message in the
Mailbox |
long |
getLastUid(Mailbox<Id> mailbox)
Return the last uid which were used for storing a Message in the
Mailbox |
protected abstract MessageMetaData |
save(Mailbox<Id> mailbox,
Message<Id> message)
|
Iterator<UpdatedFlags> |
updateFlags(Mailbox<Id> mailbox,
javax.mail.Flags flags,
boolean value,
boolean replace,
MessageRange set)
Update flags for the given
MessageRange. |
begin, commit, execute, rollbackclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcountMessagesInMailbox, countUnseenMessagesInMailbox, delete, expungeMarkedForDeletionInMailbox, findFirstUnseenMessageUid, findInMailbox, findRecentMessageUidsInMailboxendRequest, executeprotected final MailboxSession mailboxSession
public AbstractMessageMapper(MailboxSession mailboxSession, UidProvider<Id> uidProvider, ModSeqProvider<Id> modSeqProvider)
public long getHighestModSeq(Mailbox<Id> mailbox) throws MailboxException
MessageMapperMailboxgetHighestModSeq in interface MessageMapper<Id>MailboxExceptionMessageMapper.getHighestModSeq(org.apache.james.mailbox.store.mail.model.Mailbox)public long getLastUid(Mailbox<Id> mailbox) throws MailboxException
MessageMapperMailboxgetLastUid in interface MessageMapper<Id>MailboxExceptionMessageMapper.getLastUid(org.apache.james.mailbox.store.mail.model.Mailbox)public Iterator<UpdatedFlags> updateFlags(Mailbox<Id> mailbox, javax.mail.Flags flags, boolean value, boolean replace, MessageRange set) throws MailboxException
MessageMapperMessageRange. Only the flags may be modified after a message was saved to a mailbox.updateFlags in interface MessageMapper<Id>MailboxExceptionMessageMapper.updateFlags(org.apache.james.mailbox.store.mail.model.Mailbox, javax.mail.Flags, boolean, boolean, org.apache.james.mailbox.model.MessageRange)public MessageMetaData add(Mailbox<Id> mailbox, Message<Id> message) throws MailboxException
MessageMapperMessage to the underlying storage. Be aware that implementation may choose to replace the uid of the given message while storing.
So you should only depend on the returned uid.add in interface MessageMapper<Id>MailboxExceptionMessageMapper.add(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.Message)public MessageMetaData copy(Mailbox<Id> mailbox, Message<Id> original) throws MailboxException
MessageMapperMessage to a new mailbox and return the uid of the copy. Be aware that the given uid is just a suggestion for the uid of the copied
message. Implementation may choose to use a different one, so only depend on the returned uid!copy in interface MessageMapper<Id>mailbox - the Mailbox to copy tooriginal - the original to copyMailboxExceptionMessageMapper.copy(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.Message)protected abstract MessageMetaData save(Mailbox<Id> mailbox, Message<Id> message) throws MailboxException
mailbox - message - MailboxExceptionprotected abstract MessageMetaData copy(Mailbox<Id> mailbox, long uid, long modSeq, Message<Id> original) throws MailboxException
mailbox - uid - modSeq - original - MailboxExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.