com.atlassian.crowd.manager.directory.monitor.poller
Interface DirectoryPollerManager

All Known Implementing Classes:
AbstractQuartzDirectoryPollerManager, NoopPollerManager, QuartzDirectoryPollerManager, SpringQuartzDirectoryPollerManager, SpringQuartzDirectoryPollerManagerForTesting, UnsupportedDirectoryPollerManager

public interface DirectoryPollerManager

Manager for adding and removing DirectoryPollers. The pollers are scheduled via the Quartz/Spring scheduling subsystem. Implementations are used in a thread-safe manner by the DirectoryMonitorManager.


Method Summary
 void addPoller(DirectoryPoller poller)
          Adds a configured DirectoryPoller to the scheduler.
 boolean hasPoller(long directoryID)
          Checks whether a DirectoryPoller is scheduled to poll a given directory.
 void removeAllPollers()
          Attempts to unregister all registered pollers.
 boolean removePoller(long directoryID)
          Removes the DirectoryPoller from the scheduler if one exists for the given directory.
 void triggerPoll(long directoryID, SynchronisationMode synchronisationMode)
          Manually triggers the directory poller to immediately poll the directory and synchronise changes.
 

Method Detail

addPoller

void addPoller(DirectoryPoller poller)
               throws DirectoryMonitorRegistrationException
Adds a configured DirectoryPoller to the scheduler.

Parameters:
poller - configured DirectoryPoller.
Throws:
DirectoryMonitorRegistrationException - error registering poller with scheduler.

hasPoller

boolean hasPoller(long directoryID)
Checks whether a DirectoryPoller is scheduled to poll a given directory.

Parameters:
directoryID - directory ID.
Returns:
true if and only if a poller has been scheduled.

triggerPoll

void triggerPoll(long directoryID,
                 SynchronisationMode synchronisationMode)
Manually triggers the directory poller to immediately poll the directory and synchronise changes. This can be used to asynchronously start a directory synchronisation using the underlying scheduler. If a manual poll is triggered while another poll is running, the manual poll will not queue (i.e. it will do nothing). You can check if a directory is currently synchronising by calling the DirectoryManager.isSynchronising(long). If the directory does not exist or has no poller associated with it, this method will do nothing. You can check if a directory has a poller associated with it by calling hasPoller(long).

Parameters:
directoryID - directory ID.
synchronisationMode - determines whether the poll only requests elements that have changed since a timestamp or if it queries for the entire user base from the remote directory and determines changes locally.

removePoller

boolean removePoller(long directoryID)
                     throws DirectoryMonitorUnregistrationException
Removes the DirectoryPoller from the scheduler if one exists for the given directory.

Parameters:
directoryID - directory ID.
Returns:
true if and only if a poller existed and was removed from polling the given directory.
Throws:
DirectoryMonitorUnregistrationException - If an error occurs during remove.

removeAllPollers

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



Copyright © 2014 Atlassian. All Rights Reserved.