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, isClosed
public LazyMessageSearchIndex(ListeningMessageSearchIndex<Id> index)
public void add(MailboxSession session, Mailbox<Id> mailbox, Message<Id> message) throws MailboxException
ListeningMessageSearchIndex
add
in class ListeningMessageSearchIndex<Id>
MailboxException
public void delete(MailboxSession session, Mailbox<Id> mailbox, MessageRange range) throws MailboxException
ListeningMessageSearchIndex
MessageRange
for the given Mailbox
from the indexdelete
in class ListeningMessageSearchIndex<Id>
MailboxException
public 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
completeMailboxException
public void update(MailboxSession session, Mailbox<Id> mailbox, MessageRange range, javax.mail.Flags flags) throws MailboxException
ListeningMessageSearchIndex
update
in class ListeningMessageSearchIndex<Id>
MailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.