org.apache.james.mailbox.util
Class MailboxEventDispatcher

java.lang.Object
  extended by org.apache.james.mailbox.util.MailboxEventDispatcher
All Implemented Interfaces:
MailboxListener

public class MailboxEventDispatcher
extends java.lang.Object
implements MailboxListener

Helper class to dispatch Event's to registerend MailboxListener


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.apache.james.mailbox.MailboxListener
MailboxListener.Added, MailboxListener.Event, MailboxListener.Expunged, MailboxListener.FlagsUpdated, MailboxListener.MailboxDeletionEvent, MailboxListener.MailboxRenamed, MailboxListener.MessageEvent
 
Constructor Summary
MailboxEventDispatcher()
           
 
Method Summary
 void added(long uid, long sessionId, MailboxPath path)
          Should get called when a new message was added to a Mailbox.
 void addMailboxListener(MailboxListener mailboxListener)
          Add a MailboxListener to this dispatcher
 int count()
          Return the the count of all registered MailboxListener
 void event(MailboxListener.Event event)
          Informs this listener about the given event.
 void expunged(long uid, long sessionId, MailboxPath path)
          Should get called when a message was expunged from a Mailbox.
 void flagsUpdated(long uid, long sessionId, MailboxPath path, javax.mail.Flags original, javax.mail.Flags updated)
          Should get called when the message flags were update in a Mailbox.
 boolean isClosed()
          Is this listener closed?
 void mailboxDeleted(long sessionId, MailboxPath path)
          Should get called when a Mailbox was deleted.
 void mailboxRenamed(MailboxPath from, MailboxPath to, long sessionId)
          Should get called when a Mailbox was renamed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailboxEventDispatcher

public MailboxEventDispatcher()
Method Detail

addMailboxListener

public void addMailboxListener(MailboxListener mailboxListener)
Add a MailboxListener to this dispatcher

Parameters:
mailboxListener -

added

public void added(long uid,
                  long sessionId,
                  MailboxPath path)
Should get called when a new message was added to a Mailbox. All registered MailboxListener will get triggered then

Parameters:
uid -
sessionId -
path -

expunged

public void expunged(long uid,
                     long sessionId,
                     MailboxPath path)
Should get called when a message was expunged from a Mailbox. All registered MailboxListener will get triggered then

Parameters:
uid -
sessionId -
path -

flagsUpdated

public void flagsUpdated(long uid,
                         long sessionId,
                         MailboxPath path,
                         javax.mail.Flags original,
                         javax.mail.Flags updated)
Should get called when the message flags were update in a Mailbox. All registered MailboxListener will get triggered then

Parameters:
uid -
sessionId -
path -
original -
updated -

event

public void event(MailboxListener.Event event)
Description copied from interface: MailboxListener
Informs this listener about the given event.

Specified by:
event in interface MailboxListener
Parameters:
event - not null

count

public int count()
Return the the count of all registered MailboxListener

Returns:
count

mailboxRenamed

public void mailboxRenamed(MailboxPath from,
                           MailboxPath to,
                           long sessionId)
Should get called when a Mailbox was renamed. All registered MailboxListener will get triggered then

Parameters:
from -
to -
sessionId -

mailboxDeleted

public void mailboxDeleted(long sessionId,
                           MailboxPath path)
Should get called when a Mailbox was deleted. All registered MailboxListener will get triggered then

Parameters:
sessionId -
path -

isClosed

public boolean isClosed()
Description copied from interface: MailboxListener
Is this listener closed? Closed listeners may be unsubscribed.

Specified by:
isClosed in interface MailboxListener
Returns:
true when closed, false when open


Copyright © 2002-2010 The Apache Software Foundation. All Rights Reserved.