com.atlassian.crowd.manager.directory
Interface DirectorySynchroniserHelper

All Known Implementing Classes:
DirectorySynchroniserHelperImpl

public interface DirectorySynchroniserHelper

Helper class for performing a synchronisation on the SynchronisableDirectory's cache. Implementations of this interface are responsible for ensuring that database operations are wrapped in a transaction where applicable.


Method Summary
 boolean isSynchronising(long synchronisableDirectoryId)
          Returns true if the given directory is currently being synchronised.
 void synchronise(SynchronisableDirectory synchronisableDirectory, SynchronisationMode mode, SynchronisationStatusManager synchronisationStatusManager)
          Calls synchronisableDirectory's SynchronisableDirectory.synchroniseCache(com.atlassian.crowd.embedded.api.Directory, SynchronisationMode, SynchronisationStatusManager) method.
 void updateSyncEndTime(SynchronisableDirectory synchronisableDirectory)
          Updates information relevant to a directory's current synchronisation end time.
 void updateSyncStartTime(SynchronisableDirectory synchronisableDirectory)
          Updates a SynchronisableDirectory's current synchronisation start time.
 

Method Detail

updateSyncStartTime

void updateSyncStartTime(SynchronisableDirectory synchronisableDirectory)
                         throws DirectoryNotFoundException
Updates a SynchronisableDirectory's current synchronisation start time.

Parameters:
synchronisableDirectory - directory to update
Throws:
DirectoryNotFoundException - if the directory could not be found

updateSyncEndTime

void updateSyncEndTime(SynchronisableDirectory synchronisableDirectory)
                       throws DirectoryNotFoundException
Updates information relevant to a directory's current synchronisation end time. The duration, last sync start time and current sync start time will be updated.

updateSyncStartTime(com.atlassian.crowd.directory.SynchronisableDirectory) must have been invoked before this method call.

Parameters:
synchronisableDirectory - directory to update
Throws:
java.lang.IllegalStateException - if the directory is not currently synchronising.
DirectoryNotFoundException - If the directory could not be found

synchronise

void synchronise(SynchronisableDirectory synchronisableDirectory,
                 SynchronisationMode mode,
                 SynchronisationStatusManager synchronisationStatusManager)
                 throws OperationFailedException,
                        DirectoryNotFoundException
Calls synchronisableDirectory's SynchronisableDirectory.synchroniseCache(com.atlassian.crowd.embedded.api.Directory, SynchronisationMode, SynchronisationStatusManager) method.

Parameters:
synchronisableDirectory - the directory to synchronise.
mode - synchronisation mode
synchronisationStatusManager - listener for synchronisation status change notifications
Throws:
OperationFailedException - If the synchronisation failed
DirectoryNotFoundException - if the directory could not be found

isSynchronising

boolean isSynchronising(long synchronisableDirectoryId)
                        throws DirectoryNotFoundException
Returns true if the given directory is currently being synchronised.

Parameters:
synchronisableDirectoryId - synchronisable directory id
Returns:
true if the given directory is currently being synchronised
Throws:
DirectoryNotFoundException - if the directory could not be found


Copyright © 2011 Atlassian. All Rights Reserved.