public class HBaseMessageMapper extends NonTransactionalMapper implements MessageMapper<UUID>
MessageMapper.
I don't know if this class is thread-safe! Asume it is not!MessageMapper.FetchTypeMapper.Transaction<T>, Mapper.VoidTransaction| Constructor and Description |
|---|
HBaseMessageMapper(MailboxSession session,
UidProvider<UUID> uidProvider,
ModSeqProvider<UUID> modSeqProvider,
org.apache.hadoop.conf.Configuration conf) |
| Modifier and Type | Method and Description |
|---|---|
MessageMetaData |
add(Mailbox<UUID> mailbox,
Message<UUID> message)
Add the given
Message to the underlying storage. |
MessageMetaData |
copy(Mailbox<UUID> mailbox,
Message<UUID> original)
Copy the given
Message to a new mailbox and return the uid of the copy. |
long |
countMessagesInMailbox(Mailbox<UUID> mailbox)
Return the count of messages in the mailbox
|
long |
countUnseenMessagesInMailbox(Mailbox<UUID> mailbox)
Return the count of unseen messages in the mailbox
|
void |
delete(Mailbox<UUID> mailbox,
Message<UUID> message)
Delete the given
Message |
void |
endRequest()
IMAP Request was complete.
|
Map<Long,MessageMetaData> |
expungeMarkedForDeletionInMailbox(Mailbox<UUID> 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<UUID> mailbox)
Return the uid of the first unseen message.
|
Iterator<Message<UUID>> |
findInMailbox(Mailbox<UUID> mailbox,
MessageRange set,
MessageMapper.FetchType fType,
int max)
|
List<Long> |
findRecentMessageUidsInMailbox(Mailbox<UUID> mailbox)
Return a List of
Message which are recent. |
long |
getHighestModSeq(Mailbox<UUID> mailbox)
Return the higest mod-sequence which were used for storing a Message in the
Mailbox |
long |
getLastUid(Mailbox<UUID> mailbox)
Return the last uid which were used for storing a Message in the
Mailbox |
protected MessageMetaData |
save(Mailbox<UUID> mailbox,
Message<UUID> message)
|
Iterator<UpdatedFlags> |
updateFlags(Mailbox<UUID> mailbox,
javax.mail.Flags flags,
boolean value,
boolean replace,
MessageRange set)
Update flags for the given
MessageRange. |
executepublic HBaseMessageMapper(MailboxSession session, UidProvider<UUID> uidProvider, ModSeqProvider<UUID> modSeqProvider, org.apache.hadoop.conf.Configuration conf)
public void endRequest()
MapperendRequest in interface Mapperpublic Iterator<Message<UUID>> findInMailbox(Mailbox<UUID> 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 uidfindInMailbox in interface MessageMapper<UUID>mailbox - 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 itMailboxExceptionpublic Map<Long,MessageMetaData> expungeMarkedForDeletionInMailbox(Mailbox<UUID> 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 orderedexpungeMarkedForDeletionInMailbox in interface MessageMapper<UUID>MailboxExceptionpublic long countMessagesInMailbox(Mailbox<UUID> mailbox) throws MailboxException
MessageMappercountMessagesInMailbox in interface MessageMapper<UUID>MailboxExceptionpublic long countUnseenMessagesInMailbox(Mailbox<UUID> mailbox) throws MailboxException
MessageMappercountUnseenMessagesInMailbox in interface MessageMapper<UUID>MailboxExceptionpublic void delete(Mailbox<UUID> mailbox, Message<UUID> message) throws MailboxException
MessageMapperMessagedelete in interface MessageMapper<UUID>MailboxExceptionpublic Long findFirstUnseenMessageUid(Mailbox<UUID> mailbox) throws MailboxException
MessageMapperfindFirstUnseenMessageUid in interface MessageMapper<UUID>MailboxExceptionpublic List<Long> findRecentMessageUidsInMailbox(Mailbox<UUID> mailbox) throws MailboxException
MessageMapperfindRecentMessageUidsInMailbox in interface MessageMapper<UUID>MailboxExceptionpublic MessageMetaData add(Mailbox<UUID> mailbox, Message<UUID> 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<UUID>MailboxExceptionpublic Iterator<UpdatedFlags> updateFlags(Mailbox<UUID> 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<UUID>MailboxExceptionpublic MessageMetaData copy(Mailbox<UUID> mailbox, Message<UUID> 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<UUID>mailbox - the Mailbox to copy tooriginal - the original to copyMailboxExceptionpublic long getLastUid(Mailbox<UUID> mailbox) throws MailboxException
MessageMapperMailboxgetLastUid in interface MessageMapper<UUID>MailboxExceptionpublic long getHighestModSeq(Mailbox<UUID> mailbox) throws MailboxException
MessageMapperMailboxgetHighestModSeq in interface MessageMapper<UUID>MailboxExceptionprotected MessageMetaData save(Mailbox<UUID> mailbox, Message<UUID> message) throws MailboxException
mailbox - message - MailboxExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.