Class AbstractCacheRefresher<G extends GroupWithAttributes>

java.lang.Object
com.atlassian.crowd.directory.synchronisation.cache.AbstractCacheRefresher<G>
All Implemented Interfaces:
CacheRefresher
Direct Known Subclasses:
EventTokenChangedCacheRefresher, RemoteDirectoryCacheRefresher, UsnChangedCacheRefresher

public abstract class AbstractCacheRefresher<G extends GroupWithAttributes> extends Object implements CacheRefresher
Since:
v2.1
  • Field Details

  • Constructor Details

    • AbstractCacheRefresher

      public AbstractCacheRefresher(RemoteDirectory remoteDirectory)
  • Method Details

    • synchroniseAll

      public CacheSynchronisationResult 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
      Parameters:
      directoryCache - the DirectoryCache to update.
      Returns:
      result of synchronisation
      Throws:
      OperationFailedException - if there was an error processing the operation
    • synchroniseAllUsers

      protected abstract PartialSynchronisationResult<? extends UserWithAttributes> synchroniseAllUsers(DirectoryCache directoryCache) throws OperationFailedException
      This method is expected to fetch the users to update (or all currently in the remote directory) and update the directory cache (call the appropriate method for deleting and then the appropriate method for updating/adding). This will only fetch user attributes when user attribute synchronisation is enabled. User attributes will be updated if fetched in synchroniseAll(DirectoryCache) if the directory allows that.
      Parameters:
      directoryCache - the cache which this method should update
      Returns:
      list of users that were passed into the directory cache and an optional sync token if the directory has separate sync tokens for users and groups
      Throws:
      OperationFailedException
    • synchroniseAllGroups

      protected abstract PartialSynchronisationResult<G> synchroniseAllGroups(DirectoryCache directoryCache) throws OperationFailedException
      This method is expected to fetch the groups to update (or all currently in the remote directory) and update the directory cache (call the appropriate method for deleting and then the appropriate method for updating/adding). This will only fetch group attributes when group attribute synchronisation is enabled. Group attributes will be updated if fetched in synchroniseAll(DirectoryCache) if the directory allows that.
      Parameters:
      directoryCache - the cache which this method should update
      Returns:
      list of groups that were passed into the directory cache and an optional sync token if the directory has separate sync tokens for users and groups
      Throws:
      OperationFailedException
    • getMemberships

      protected Iterable<Membership> getMemberships(Collection<G> groups, boolean isFullSync) throws OperationFailedException
      Throws:
      OperationFailedException
    • isUserAttributeSynchronisationEnabled

      protected boolean isUserAttributeSynchronisationEnabled()
    • logUserAttributeSynchronisationEnabledWarning

      protected void logUserAttributeSynchronisationEnabledWarning()
    • logGroupAttributeSynchronisationEnabledWarning

      protected void logGroupAttributeSynchronisationEnabledWarning()
    • isGroupAttributeSynchronisationEnabled

      protected boolean isGroupAttributeSynchronisationEnabled()
    • synchroniseAllUserAttributes

      protected void synchroniseAllUserAttributes(Collection<? extends UserWithAttributes> remoteUsers, DirectoryCache directoryCache) throws OperationFailedException
      Throws:
      OperationFailedException
    • synchroniseAllGroupAttributes

      protected void synchroniseAllGroupAttributes(Collection<G> remoteGroups, DirectoryCache directoryCache) throws OperationFailedException
      Throws:
      OperationFailedException
    • synchroniseMemberships

      protected void synchroniseMemberships(Collection<G> remoteGroups, DirectoryCache directoryCache, boolean isFullSync) throws OperationFailedException
      Throws:
      OperationFailedException
    • isIncrementalSyncEnabled

      protected boolean isIncrementalSyncEnabled()
    • directoryDescription

      protected String directoryDescription()