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
 Directory findDirectoryById(long directoryId)
          Returns a Directory based on the passed in directoryId.
 boolean isSynchronising(long synchronisableDirectoryId)
          Returns true if the given directory is currently being synchronised.
 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:
IllegalStateException - if the directory is not currently synchronising.
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

findDirectoryById

Directory findDirectoryById(long directoryId)
                            throws DirectoryNotFoundException
Returns a Directory based on the passed in directoryId. Essentially equivalent to DirectoryManager.findDirectoryById(long), it exists to obtain the directory configuration without introducing a dependency on the complex DirectoryManager.

Parameters:
directoryId - the id of the directory to find
Returns:
the directory
Throws:
DirectoryNotFoundException - is thrown if the Directory cannot be found.


Copyright © 2016 Atlassian. All Rights Reserved.