Id
- public abstract class ListeningMessageSearchIndex<Id> extends Object implements MessageSearchIndex<Id>, MailboxListener
MessageSearchIndex
which needs to get registered as global MailboxListener
and so get
notified about message changes. This will then allow to update the underlying index.MailboxListener.Added, MailboxListener.Event, MailboxListener.Expunged, MailboxListener.FlagsUpdated, MailboxListener.MailboxACLUpdated, MailboxListener.MailboxAdded, MailboxListener.MailboxDeletion, MailboxListener.MailboxRenamed, MailboxListener.MessageEvent
Constructor and Description |
---|
ListeningMessageSearchIndex(MessageMapperFactory<Id> factory) |
Modifier and Type | Method and Description |
---|---|
abstract void |
add(MailboxSession session,
Mailbox<Id> mailbox,
Message<Id> message)
|
abstract void |
delete(MailboxSession session,
Mailbox<Id> mailbox,
MessageRange range)
Delete the
MessageRange for the given Mailbox from the index |
void |
event(MailboxListener.Event event)
Process the
MailboxListener.Event and update the index if
something relevant is received |
protected MessageMapperFactory<Id> |
getFactory()
Return the
MessageMapperFactory |
boolean |
isClosed()
Never closed
|
abstract void |
update(MailboxSession session,
Mailbox<Id> mailbox,
MessageRange range,
javax.mail.Flags flags)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
search
public ListeningMessageSearchIndex(MessageMapperFactory<Id> factory)
protected MessageMapperFactory<Id> getFactory()
MessageMapperFactory
public void event(MailboxListener.Event event)
MailboxListener.Event
and update the index if
something relevant is receivedevent
in interface MailboxListener
event
- not nullpublic boolean isClosed()
public abstract void add(MailboxSession session, Mailbox<Id> mailbox, Message<Id> message) throws MailboxException
session
- mailbox
- message
- MailboxException
public abstract void delete(MailboxSession session, Mailbox<Id> mailbox, MessageRange range) throws MailboxException
MessageRange
for the given Mailbox
from the indexsession
- mailbox
- range
- MailboxException
public abstract void update(MailboxSession session, Mailbox<Id> mailbox, MessageRange range, javax.mail.Flags flags) throws MailboxException
session
- mailbox
- range
- flags
- MailboxException
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.