com.atlassian.crowd.manager.directory
Class DirectorySynchroniserHelperImpl

java.lang.Object
  extended by com.atlassian.crowd.manager.directory.DirectorySynchroniserHelperImpl
All Implemented Interfaces:
DirectorySynchroniserHelper

public class DirectorySynchroniserHelperImpl
extends Object
implements DirectorySynchroniserHelper

A DirectorySynchroniserHelper that requests a SynchronisableDirectory synchronises its cache, and stores synchronisation information in the Directory's attributes.


Constructor Summary
DirectorySynchroniserHelperImpl(DirectoryDao directoryDao, com.atlassian.event.api.EventPublisher eventPublisher)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectorySynchroniserHelperImpl

public DirectorySynchroniserHelperImpl(DirectoryDao directoryDao,
                                       com.atlassian.event.api.EventPublisher eventPublisher)
Method Detail

updateSyncStartTime

public void updateSyncStartTime(SynchronisableDirectory synchronisableDirectory)
                         throws DirectoryNotFoundException
Description copied from interface: DirectorySynchroniserHelper
Updates a SynchronisableDirectory's current synchronisation start time.

Specified by:
updateSyncStartTime in interface DirectorySynchroniserHelper
Parameters:
synchronisableDirectory - directory to update
Throws:
DirectoryNotFoundException - if the directory could not be found

updateSyncEndTime

public void updateSyncEndTime(SynchronisableDirectory synchronisableDirectory)
                       throws DirectoryNotFoundException
Description copied from interface: DirectorySynchroniserHelper
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.

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

Specified by:
updateSyncEndTime in interface DirectorySynchroniserHelper
Parameters:
synchronisableDirectory - directory to update
Throws:
DirectoryNotFoundException - If the directory could not be found

isSynchronising

public boolean isSynchronising(long synchronisableDirectoryId)
                        throws DirectoryNotFoundException
Description copied from interface: DirectorySynchroniserHelper
Returns true if the given directory is currently being synchronised.

Specified by:
isSynchronising in interface DirectorySynchroniserHelper
Parameters:
synchronisableDirectoryId - synchronisable directory id
Returns:
true if the given directory is currently being synchronised
Throws:
DirectoryNotFoundException - if the directory could not be found

handleEvent

@EventListener
public void handleEvent(DirectoryUpdatedEvent event)
Removes SynchronisableDirectoryProperties.IS_SYNCHRONISING attribute from the updated directory, so we can recognise when a directory requires initial synchronisation.

Parameters:
event - directory update event


Copyright © 2013 Atlassian. All Rights Reserved.