public class InMemoryMessageMapper extends AbstractMessageMapper<Long>
MessageMapper.FetchType
Mapper.Transaction<T>, Mapper.VoidTransaction
mailboxSession
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, updateFlags
execute
public InMemoryMessageMapper(MailboxSession session, UidProvider<Long> uidProvider, ModSeqProvider<Long> modSeqProvider)
public long countMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException
MessageMapper
MailboxException
MessageMapper.countMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
public long countUnseenMessagesInMailbox(Mailbox<Long> mailbox) throws MailboxException
MessageMapper
MailboxException
MessageMapper.countUnseenMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
public void delete(Mailbox<Long> mailbox, Message<Long> message) throws MailboxException
MessageMapper
Message
public Iterator<Message<Long>> findInMailbox(Mailbox<Long> mailbox, MessageRange set, MessageMapper.FetchType ftype, int max) throws MailboxException
MessageMapper
Iterator
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 itMailboxException
MessageMapper.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
MessageMapper
MailboxException
MessageMapper.findRecentMessageUidsInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
public Long findFirstUnseenMessageUid(Mailbox<Long> mailbox) throws MailboxException
MessageMapper
MailboxException
MessageMapper.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
AbstractMessageMapper
copy
in class AbstractMessageMapper<Long>
MailboxException
AbstractMessageMapper.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
AbstractMessageMapper
save
in class AbstractMessageMapper<Long>
MailboxException
AbstractMessageMapper.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 TransactionalMapper
MailboxException
protected void commit() throws MailboxException
commit
in class TransactionalMapper
MailboxException
protected void rollback() throws MailboxException
rollback
in class TransactionalMapper
MailboxException
public Map<Long,MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<Long> mailbox, MessageRange set) throws MailboxException
MessageMapper
Iterator
which holds the uids for all deleted Messages for the given MessageRange
which are marked for deletion
The list must be orderedMailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.