Id
- public abstract class AbstractMessageMapper<Id> extends TransactionalMapper implements MessageMapper<Id>
MessageMapper
implementation which already takes care of most uid / mod-seq handlingMessageMapper.FetchType
Mapper.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, rollback
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
countMessagesInMailbox, countUnseenMessagesInMailbox, delete, expungeMarkedForDeletionInMailbox, findFirstUnseenMessageUid, findInMailbox, findRecentMessageUidsInMailbox
endRequest, execute
protected final MailboxSession mailboxSession
public AbstractMessageMapper(MailboxSession mailboxSession, UidProvider<Id> uidProvider, ModSeqProvider<Id> modSeqProvider)
public long getHighestModSeq(Mailbox<Id> mailbox) throws MailboxException
MessageMapper
Mailbox
getHighestModSeq
in interface MessageMapper<Id>
MailboxException
MessageMapper.getHighestModSeq(org.apache.james.mailbox.store.mail.model.Mailbox)
public long getLastUid(Mailbox<Id> mailbox) throws MailboxException
MessageMapper
Mailbox
getLastUid
in interface MessageMapper<Id>
MailboxException
MessageMapper.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
MessageMapper
MessageRange
. Only the flags may be modified after a message was saved to a mailbox.updateFlags
in interface MessageMapper<Id>
MailboxException
MessageMapper.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
MessageMapper
Message
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>
MailboxException
MessageMapper.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
MessageMapper
Message
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 copyMailboxException
MessageMapper.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
- MailboxException
protected abstract MessageMetaData copy(Mailbox<Id> mailbox, long uid, long modSeq, Message<Id> original) throws MailboxException
mailbox
- uid
- modSeq
- original
- MailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.