com.atlassian.crowd.manager.directory.monitor
Interface DirectoryMonitorManager

All Known Implementing Classes:
DirectoryMonitorManagerImpl

public interface DirectoryMonitorManager

Manages directory monitoring by allowing adding and removal of DirectoryMonitors. Once a monitor has been added via this manager, it will monitor the directory either via listening to remote mutation events or via polling the remote directory periodically. One directory can have at most one monitor. Implementations are required to be thread-safe.


Method Summary
 void addMonitor(long directoryID)
          Adds a monitor to a particular directory.
 boolean hasMonitor(long directoryID)
          Determines whether a directory is currently being monitored.
 boolean removeMonitor(long directoryID)
          Removes a monitor from a monitored directory.
 

Method Detail

addMonitor

void addMonitor(long directoryID)
                throws ObjectNotFoundException,
                       DirectoryInstantiationException,
                       DirectoryMonitorCreationException,
                       DirectoryMonitorRegistrationException,
                       DirectoryMonitorAlreadyRegisteredException
Adds a monitor to a particular directory. The type of monitor added depends on whether the directory is PollingCapable or ListeningCapable.

Parameters:
directoryID - directory ID.
Throws:
ObjectNotFoundException - if a directory with the supplied ID does not exist.
DirectoryInstantiationException - if the raw remote directory cannot be instantiated.
DirectoryMonitorCreationException - if there was an error creating a monitor for the directory.
DirectoryMonitorRegistrationException - if there was an error registering the monitor.
DirectoryMonitorAlreadyRegisteredException - hasMonitor(directoryID) returns true.

removeMonitor

boolean removeMonitor(long directoryID)
                      throws DirectoryMonitorUnregistrationException
Removes a monitor from a monitored directory.

Parameters:
directoryID - directory ID.
Returns:
true if a monitor was removed.
Throws:
DirectoryMonitorUnregistrationException - if there was an error removing the monitor.

hasMonitor

boolean hasMonitor(long directoryID)
Determines whether a directory is currently being monitored.

Parameters:
directoryID - directory ID.
Returns:
true if an only if the directory is being monitored via a registered DirectoryListener or a DirectoryPoller.


Copyright © 2009 Atlassian Pty Ltd. All Rights Reserved.