public abstract class AbstractDelegatingMailboxListener extends Object implements MailboxListener, MailboxListenerSupport
MailboxListener.Added, MailboxListener.Event, MailboxListener.Expunged, MailboxListener.FlagsUpdated, MailboxListener.MailboxACLUpdated, MailboxListener.MailboxAdded, MailboxListener.MailboxDeletion, MailboxListener.MailboxRenamed, MailboxListener.MessageEvent
Modifier | Constructor and Description |
---|---|
protected |
AbstractDelegatingMailboxListener() |
Modifier and Type | Method and Description |
---|---|
void |
addGlobalListener(MailboxListener listener,
MailboxSession session)
Add a
MailboxListener which get fired for ever
MailboxPath |
void |
addListener(MailboxPath path,
MailboxListener listener,
MailboxSession session)
Implementations of Mailbox may interpret the fact that someone is
listening and do some caching and even postpone persistence until
everyone has removed itself.
|
void |
event(MailboxListener.Event event)
Receive the event and dispatch it to the right
MailboxListener depending on
MailboxListener.Event.getMailboxPath() |
protected abstract List<MailboxListener> |
getGlobalListeners()
Return the
List which is used tos tore the global MailboxListener |
protected abstract Map<MailboxPath,List<MailboxListener>> |
getListeners()
Return the
Map which is used to store the MailboxListener |
void |
removeGlobalListener(MailboxListener listener,
MailboxSession session)
Remove the
MailboxListener |
void |
removeListener(MailboxPath mailboxPath,
MailboxListener listener,
MailboxSession session)
Remove the
MailboxListener |
public void event(MailboxListener.Event event)
MailboxListener
depending on
MailboxListener.Event.getMailboxPath()
event
in interface MailboxListener
event
- not nullpublic void addListener(MailboxPath path, MailboxListener listener, MailboxSession session) throws MailboxException
MailboxListenerSupport
Implementations of Mailbox may interpret the fact that someone is listening and do some caching and even postpone persistence until everyone has removed itself.
addListener
in interface MailboxListenerSupport
path
- not nulllistener
- not nullsession
- not nullMailboxException
MailboxListenerSupport.addListener(org.apache.james.mailbox.model.MailboxPath, org.apache.james.mailbox.MailboxListener, org.apache.james.mailbox.MailboxSession)
public void addGlobalListener(MailboxListener listener, MailboxSession session) throws MailboxException
MailboxListenerSupport
MailboxListener
which get fired for ever
MailboxPath
addGlobalListener
in interface MailboxListenerSupport
MailboxException
MailboxListenerSupport.addGlobalListener(org.apache.james.mailbox.MailboxListener, org.apache.james.mailbox.MailboxSession)
public void removeListener(MailboxPath mailboxPath, MailboxListener listener, MailboxSession session) throws MailboxException
MailboxListenerSupport
MailboxListener
public void removeGlobalListener(MailboxListener listener, MailboxSession session) throws MailboxException
MailboxListenerSupport
MailboxListener
removeGlobalListener
in interface MailboxListenerSupport
MailboxException
MailboxListenerSupport.removeGlobalListener(org.apache.james.mailbox.MailboxListener, org.apache.james.mailbox.MailboxSession)
protected abstract Map<MailboxPath,List<MailboxListener>> getListeners()
Map
which is used to store the MailboxListener
protected abstract List<MailboxListener> getGlobalListeners()
List
which is used tos tore the global MailboxListener
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.