com.atlassian.crowd.manager.directory.monitor.listener
Interface DirectoryListenerManager

All Known Implementing Classes:
DirectoryListenerManagerImpl

public interface DirectoryListenerManager

Manager for adding and removing DirectoryPollers. Implementations are used in a thread-safe manner by the DirectoryMonitorManager.


Method Summary
 void addListener(DirectoryListener listener)
          Registers a configured DirectoryListener and starts listening.
 boolean hasListener(long directoryID)
          Checks whether a DirectoryListener is currently listening.
 void removeAllListeners()
          Attempts to unregister all registered listeners.
 boolean removeListener(long directoryID)
          Unregisters the DirectoryListener and stops listening.
 

Method Detail

addListener

void addListener(DirectoryListener listener)
                 throws DirectoryMonitorRegistrationException
Registers a configured DirectoryListener and starts listening.

Parameters:
listener - configured DirectoryListener.
Throws:
DirectoryMonitorRegistrationException - error starting listener.

hasListener

boolean hasListener(long directoryID)
Checks whether a DirectoryListener is currently listening.

Parameters:
directoryID - directory ID.
Returns:
true if and only if a listener has been successfully added.

removeListener

boolean removeListener(long directoryID)
                       throws DirectoryMonitorUnregistrationException
Unregisters the DirectoryListener and stops listening.

Parameters:
directoryID - directory ID.
Returns:
true if and only if a listener existed and was removed from listening to given directory.
Throws:
DirectoryMonitorUnregistrationException

removeAllListeners

void removeAllListeners()
Attempts to unregister all registered listeners. Skips over any directories that fail unregistration.



Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.