com.atlassian.crowd.directory.ldap.cache
Class UsnChangedCacheRefresher

java.lang.Object
  extended by com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher
      extended by com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresher
All Implemented Interfaces:
CacheRefresher

public class UsnChangedCacheRefresher
extends AbstractCacheRefresher
implements CacheRefresher

Retrieves latest changes from MS Active Directory in order to allow "delta" cache refreshes.

See http://msdn.microsoft.com/en-us/library/ms677625.aspx and http://msdn.microsoft.com/en-us/library/ms677627%28VS.85%29.aspx for details on polling Microsoft Active Directory.

This class is guaranteed to be run from a single thread at a time by per directory. This means it does not need to worry about race-conditions, but still must consider safe publication of variables (per directory).


Field Summary
 
Fields inherited from class com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher
remoteDirectory
 
Constructor Summary
UsnChangedCacheRefresher(MicrosoftActiveDirectory activeDirectory)
           
 
Method Summary
 void synchroniseAll(DirectoryCache directoryCache)
          Will visit all Users and Groups in the external directory in order to do a Full refresh.
protected  List<? extends Group> synchroniseAllGroups(DirectoryCache directoryCache)
           
protected  void synchroniseAllUsers(DirectoryCache directoryCache)
           
 boolean synchroniseChanges(DirectoryCache directoryCache)
          Attempts to synchronise changes since the last refresh as opposed to performing a full synchronisation.
 
Methods inherited from class com.atlassian.crowd.directory.ldap.cache.AbstractCacheRefresher
directoryDescription, filterOutDuplicateGroups, synchroniseMemberships
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsnChangedCacheRefresher

public UsnChangedCacheRefresher(MicrosoftActiveDirectory activeDirectory)
Method Detail

synchroniseChanges

public boolean synchroniseChanges(DirectoryCache directoryCache)
                           throws OperationFailedException
Description copied from interface: CacheRefresher
Attempts to synchronise changes since the last refresh as opposed to performing a full synchronisation. Returns true if changes since the last refresh were synchronised successfully.

Specified by:
synchroniseChanges in interface CacheRefresher
Parameters:
directoryCache - the DirectoryCache to update.
Returns:
true if changes were synchronised
Throws:
OperationFailedException - if there was an error processing the operation

synchroniseAll

public void synchroniseAll(DirectoryCache directoryCache)
                    throws OperationFailedException
Description copied from interface: CacheRefresher
Will visit all Users and Groups in the external directory in order to do a Full refresh.

Specified by:
synchroniseAll in interface CacheRefresher
Overrides:
synchroniseAll in class AbstractCacheRefresher
Parameters:
directoryCache - the DirectoryCache to update.
Throws:
OperationFailedException - if there was an error processing the operation

synchroniseAllUsers

protected void synchroniseAllUsers(DirectoryCache directoryCache)
                            throws OperationFailedException
Specified by:
synchroniseAllUsers in class AbstractCacheRefresher
Throws:
OperationFailedException

synchroniseAllGroups

protected List<? extends Group> synchroniseAllGroups(DirectoryCache directoryCache)
                                              throws OperationFailedException
Specified by:
synchroniseAllGroups in class AbstractCacheRefresher
Throws:
OperationFailedException


Copyright © 2013 Atlassian. All Rights Reserved.