Id - public class LazyMessageSearchIndex<Id> extends ListeningMessageSearchIndex<Id>
ListeningMessageSearchIndex implementation which wraps another ListeningMessageSearchIndex and will forward all calls to it.
The only special thing about this is that it will index all the mails in the mailbox on the first call of search(MailboxSession, Mailbox, SearchQuery)
This class is mostly useful for in-memory indexes or for indexed that should be recreated on every server restart.MailboxListener.Added, MailboxListener.Event, MailboxListener.Expunged, MailboxListener.FlagsUpdated, MailboxListener.MailboxACLUpdated, MailboxListener.MailboxAdded, MailboxListener.MailboxDeletion, MailboxListener.MailboxRenamed, MailboxListener.MessageEvent| Constructor and Description |
|---|
LazyMessageSearchIndex(ListeningMessageSearchIndex<Id> index) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(MailboxSession session,
Mailbox<Id> mailbox,
Message<Id> message)
|
void |
delete(MailboxSession session,
Mailbox<Id> mailbox,
MessageRange range)
Delete the
MessageRange for the given Mailbox from the index |
Iterator<Long> |
search(MailboxSession session,
Mailbox<Id> mailbox,
SearchQuery searchQuery)
Lazy index the mailbox on first search request if it was not indexed before.
|
void |
update(MailboxSession session,
Mailbox<Id> mailbox,
MessageRange range,
javax.mail.Flags flags)
|
event, getFactory, isClosedpublic LazyMessageSearchIndex(ListeningMessageSearchIndex<Id> index)
public void add(MailboxSession session, Mailbox<Id> mailbox, Message<Id> message) throws MailboxException
ListeningMessageSearchIndexadd in class ListeningMessageSearchIndex<Id>MailboxExceptionpublic void delete(MailboxSession session, Mailbox<Id> mailbox, MessageRange range) throws MailboxException
ListeningMessageSearchIndexMessageRange for the given Mailbox from the indexdelete in class ListeningMessageSearchIndex<Id>MailboxExceptionpublic Iterator<Long> search(MailboxSession session, Mailbox<Id> mailbox, SearchQuery searchQuery) throws MailboxException
MessageSearchIndex. Be aware that concurrent search requests are blocked on the same "not-yet-indexed" mailbox till it the index process was
completeMailboxExceptionpublic void update(MailboxSession session, Mailbox<Id> mailbox, MessageRange range, javax.mail.Flags flags) throws MailboxException
ListeningMessageSearchIndexupdate in class ListeningMessageSearchIndex<Id>MailboxExceptionCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.