@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(com.atlassian.crowd.embedded.spi.DirectoryDao directoryDao,
com.atlassian.event.api.EventPublisher eventPublisher) |
| 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(com.atlassian.crowd.embedded.spi.DirectoryDao directoryDao, com.atlassian.event.api.EventPublisher eventPublisher)
public void updateSyncStartTime(SynchronisableDirectory synchronisableDirectory) throws DirectoryNotFoundException
DirectorySynchroniserHelperSynchronisableDirectory's current synchronisation start time.updateSyncStartTime in interface DirectorySynchroniserHelpersynchronisableDirectory - 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 DirectorySynchroniserHelpersynchronisableDirectory - directory to updateDirectoryNotFoundException - If the directory could not be foundpublic boolean isSynchronising(long synchronisableDirectoryId)
throws DirectoryNotFoundException
DirectorySynchroniserHelperisSynchronising in interface DirectorySynchroniserHelpersynchronisableDirectoryId - synchronisable directory idDirectoryNotFoundException - if the directory could not be foundpublic Directory findDirectoryById(long directoryId) throws DirectoryNotFoundException
DirectorySynchroniserHelperdirectoryId.
Essentially equivalent to DirectoryManager.findDirectoryById(long), it exists to obtain the directory
configuration without introducing a dependency on the complex DirectoryManager.findDirectoryById in interface DirectorySynchroniserHelperdirectoryId - 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 © 2018 Atlassian. All rights reserved.