@Transactional public class DirectorySynchroniserHelperImpl extends Object implements DirectorySynchroniserHelper
DirectorySynchroniserHelper
that requests a SynchronisableDirectory
synchronises its cache, and
stores synchronisation information in the Directory
's attributes.Constructor and Description |
---|
DirectorySynchroniserHelperImpl(DirectoryDao directoryDao,
com.atlassian.event.api.EventPublisher eventPublisher,
DirectorySynchronisationInformationStore informationStore) |
Modifier and Type | Method and Description |
---|---|
Directory |
findDirectoryById(long directoryId)
Returns a Directory based on the passed in
directoryId . |
void |
handleEvent(DirectoryUpdatedEvent event)
Removes
SynchronisableDirectoryProperties.IS_SYNCHRONISING
attribute from the updated directory, so we can recognise when
a directory requires initial synchronisation. |
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. |
public DirectorySynchroniserHelperImpl(DirectoryDao directoryDao, com.atlassian.event.api.EventPublisher eventPublisher, DirectorySynchronisationInformationStore informationStore)
public void updateSyncStartTime(SynchronisableDirectory synchronisableDirectory) throws DirectoryNotFoundException
DirectorySynchroniserHelper
SynchronisableDirectory
's current synchronisation start time.updateSyncStartTime
in interface DirectorySynchroniserHelper
synchronisableDirectory
- directory to updateDirectoryNotFoundException
- if the directory could not be foundpublic void updateSyncEndTime(SynchronisableDirectory synchronisableDirectory) throws DirectoryNotFoundException
DirectorySynchroniserHelper
DirectorySynchroniserHelper.updateSyncStartTime(com.atlassian.crowd.directory.SynchronisableDirectory)
must have been invoked
before this method call.
updateSyncEndTime
in interface DirectorySynchroniserHelper
synchronisableDirectory
- directory to updateDirectoryNotFoundException
- If the directory could not be foundpublic boolean isSynchronising(long synchronisableDirectoryId) throws DirectoryNotFoundException
DirectorySynchroniserHelper
isSynchronising
in interface DirectorySynchroniserHelper
synchronisableDirectoryId
- synchronisable directory idDirectoryNotFoundException
- if the directory could not be foundpublic Directory findDirectoryById(long directoryId) throws DirectoryNotFoundException
DirectorySynchroniserHelper
directoryId
.
Essentially equivalent to DirectoryManager.findDirectoryById(long)
, it exists to obtain the directory
configuration without introducing a dependency on the complex DirectoryManager
.findDirectoryById
in interface DirectorySynchroniserHelper
directoryId
- the id of the directory to findDirectoryNotFoundException
- is thrown if the Directory cannot be found.@EventListener public void handleEvent(DirectoryUpdatedEvent event)
SynchronisableDirectoryProperties.IS_SYNCHRONISING
attribute from the updated directory, so we can recognise when
a directory requires initial synchronisation.event
- directory update eventCopyright © 2021 Atlassian. All rights reserved.