public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
MessageMapper.FetchTypeMapper.Transaction<T>, Mapper.VoidTransactionmailboxSession| Constructor and Description |
|---|
InMemoryMessageMapper(MailboxSession session,
UidProvider<Long> uidProvider,
ModSeqProvider<Long> modSeqProvider) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
begin()
Do nothing
|
protected void |
commit()
Do nothing
|
protected MessageMetaData |
copy(Mailbox<Long> mailbox,
long uid,
long modSeq,
Message<Long> original)
Copy the Message to the Mailbox, using the given uid and modSeq for the new Message
|
long |
countMessagesInMailbox(Mailbox<Long> mailbox)
Return the count of messages in the mailbox
|
long |
countUnseenMessagesInMailbox(Mailbox<Long> mailbox)
Return the count of unseen messages in the mailbox
|
void |
delete(Mailbox<Long> mailbox,
Message<Long> message)
Delete the given
Message |
void |
deleteAll() |
void |
endRequest()
Do nothing
|
Map<Long,MessageMetaData> |
expungeMarkedForDeletionInMailbox(Mailbox<Long> mailbox,
MessageRange set)
Return a
Iterator which holds the uids for all deleted Messages for the given MessageRange which are marked for deletion
The list must be ordered |
Long |
findFirstUnseenMessageUid(Mailbox<Long> mailbox)
Return the uid of the first unseen message.
|
Iterator<Message<Long>> |
findInMailbox(Mailbox<Long> mailbox,
MessageRange set,
MessageMapper.FetchType ftype,
int max)
|
List<Long> |
findRecentMessageUidsInMailbox(Mailbox<Long> mailbox)
Return a List of
Message which are recent. |
protected void |
rollback()
Do nothing
|
protected MessageMetaData |
save(Mailbox<Long> mailbox,
Message<Long> message)
|
add, copy, getHighestModSeq, getLastUid, updateFlagsexecutepublic InMemoryMessageMapper(MailboxSession session, UidProvider<Long> uidProvider, ModSeqProvider<Long> modSeqProvider)
public long countMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException
MessageMapperMailboxExceptionMessageMapper.countMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)public long countUnseenMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException
MessageMapperMailboxExceptionMessageMapper.countUnseenMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)public void delete(Mailbox<Long> mailbox, Message<Long> message) throws MailboxException
MessageMapperMessagepublic Iterator<Message<Long>> findInMailbox(Mailbox<Long> mailbox, MessageRange set, MessageMapper.FetchType ftype, int max) throws MailboxException
MessageMapperIterator which holds the messages for the given criterias
The list must be ordered by the Message uidmailbox - The mailbox to searchset - message range for batch processingmax - the maximal limit of returned Message's. Use -1 to set no limit. In any case the caller MUST not expect the limit to get applied in all cases as the implementation
MAY just ignore itMailboxExceptionMessageMapper.findInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.model.MessageRange, org.apache.james.mailbox.store.mail.MessageMapper.FetchType, int)public List<Long> findRecentMessageUidsInMailbox(Mailbox<Long> mailbox) throws MailboxException
MessageMapperMailboxExceptionMessageMapper.findRecentMessageUidsInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)public Long findFirstUnseenMessageUid(Mailbox<Long> mailbox) throws MailboxException
MessageMapperMailboxExceptionMessageMapper.findFirstUnseenMessageUid(org.apache.james.mailbox.store.mail.model.Mailbox)public void deleteAll()
public void endRequest()
protected MessageMetaData copy(Mailbox<Long> mailbox, long uid, long modSeq, Message<Long> original) throws MailboxException
AbstractMessageMappercopy in class AbstractMessageMapper<Long>MailboxExceptionAbstractMessageMapper.copy(org.apache.james.mailbox.store.mail.model.Mailbox, long, long, org.apache.james.mailbox.store.mail.model.Message)protected MessageMetaData save(Mailbox<Long> mailbox, Message<Long> message) throws MailboxException
AbstractMessageMappersave in class AbstractMessageMapper<Long>MailboxExceptionAbstractMessageMapper.save(org.apache.james.mailbox.store.mail.model.Mailbox, org.apache.james.mailbox.store.mail.model.Message)protected void begin()
throws MailboxException
begin in class TransactionalMapperMailboxExceptionprotected void commit()
throws MailboxException
commit in class TransactionalMapperMailboxExceptionprotected void rollback()
throws MailboxException
rollback in class TransactionalMapperMailboxExceptionpublic Map<Long,MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<Long> mailbox, MessageRange set) throws MailboxException
MessageMapperIterator which holds the uids for all deleted Messages for the given MessageRange which are marked for deletion
The list must be orderedMailboxExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.