public class MaildirMessageMapper extends AbstractMessageMapper<Integer>
MessageMapper.FetchType
Mapper.Transaction<T>, Mapper.VoidTransaction
mailboxSession
Constructor and Description |
---|
MaildirMessageMapper(MailboxSession session,
MaildirStore maildirStore) |
Modifier and Type | Method and Description |
---|---|
protected void |
begin()
Begin transaction
|
protected void |
commit()
Commit transaction
|
protected MessageMetaData |
copy(Mailbox<Integer> mailbox,
long uid,
long modSeq,
Message<Integer> original)
Copy the Message to the Mailbox, using the given uid and modSeq for the new Message
|
long |
countMessagesInMailbox(Mailbox<Integer> mailbox)
Return the count of messages in the mailbox
|
long |
countUnseenMessagesInMailbox(Mailbox<Integer> mailbox)
Return the count of unseen messages in the mailbox
|
void |
delete(Mailbox<Integer> mailbox,
Message<Integer> message)
Delete the given
Message |
void |
endRequest()
IMAP Request was complete.
|
Map<Long,MessageMetaData> |
expungeMarkedForDeletionInMailbox(Mailbox<Integer> 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<Integer> mailbox)
Return the uid of the first unseen message.
|
Iterator<Message<Integer>> |
findInMailbox(Mailbox<Integer> mailbox,
MessageRange set,
MessageMapper.FetchType fType,
int max)
|
List<Long> |
findRecentMessageUidsInMailbox(Mailbox<Integer> mailbox)
Return a List of
Message which are recent. |
protected void |
rollback()
Rollback transaction
|
protected MessageMetaData |
save(Mailbox<Integer> mailbox,
Message<Integer> message)
|
Iterator<UpdatedFlags> |
updateFlags(Mailbox<Integer> mailbox,
javax.mail.Flags flags,
boolean value,
boolean replace,
MessageRange set)
Update flags for the given
MessageRange . |
add, copy, getHighestModSeq, getLastUid
execute
public MaildirMessageMapper(MailboxSession session, MaildirStore maildirStore)
public long countMessagesInMailbox(Mailbox<Integer> mailbox) throws MailboxException
MessageMapper
MailboxException
MessageMapper.countMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
public long countUnseenMessagesInMailbox(Mailbox<Integer> mailbox) throws MailboxException
MessageMapper
MailboxException
MessageMapper.countUnseenMessagesInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
public void delete(Mailbox<Integer> mailbox, Message<Integer> message) throws MailboxException
MessageMapper
Message
public Iterator<Message<Integer>> findInMailbox(Mailbox<Integer> 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<Integer> mailbox) throws MailboxException
MessageMapper
MailboxException
MessageMapper.findRecentMessageUidsInMailbox(org.apache.james.mailbox.store.mail.model.Mailbox)
public Long findFirstUnseenMessageUid(Mailbox<Integer> mailbox) throws MailboxException
MessageMapper
MailboxException
MessageMapper.findFirstUnseenMessageUid(org.apache.james.mailbox.store.mail.model.Mailbox)
public void endRequest()
Mapper
Mapper.endRequest()
protected MessageMetaData copy(Mailbox<Integer> mailbox, long uid, long modSeq, Message<Integer> original) throws MailboxException
AbstractMessageMapper
copy
in class AbstractMessageMapper<Integer>
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<Integer> mailbox, Message<Integer> message) throws MailboxException
AbstractMessageMapper
save
in class AbstractMessageMapper<Integer>
MailboxException
AbstractMessageMapper.save(org.apache.james.mailbox.store.mail.model.Mailbox,
org.apache.james.mailbox.store.mail.model.Message)
protected void begin() throws MailboxException
TransactionalMapper
begin
in class TransactionalMapper
MailboxException
TransactionalMapper.begin()
protected void commit() throws MailboxException
TransactionalMapper
commit
in class TransactionalMapper
MailboxException
TransactionalMapper.commit()
protected void rollback() throws MailboxException
TransactionalMapper
rollback
in class TransactionalMapper
MailboxException
TransactionalMapper.rollback()
public Iterator<UpdatedFlags> updateFlags(Mailbox<Integer> 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<Integer>
updateFlags
in class AbstractMessageMapper<Integer>
MailboxException
MessageMapper.updateFlags(org.apache.james.mailbox.store.mail.model.Mailbox, javax.mail.Flags, boolean, boolean, org.apache.james.mailbox.model.MessageRange)
public Map<Long,MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<Integer> 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.