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 Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected String
protected Iterable<Membership>
getMemberships
(Collection<G> groups, boolean isFullSync) protected boolean
protected boolean
protected boolean
synchroniseAll
(DirectoryCache directoryCache) Will visit all Users and Groups in the external directory in order to do a Full refresh.protected void
synchroniseAllGroupAttributes
(Collection<G> remoteGroups, DirectoryCache directoryCache) protected abstract PartialSynchronisationResult<G>
synchroniseAllGroups
(DirectoryCache directoryCache) 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).protected void
synchroniseAllUserAttributes
(Collection<? extends UserWithAttributes> remoteUsers, DirectoryCache directoryCache) protected abstract PartialSynchronisationResult<? extends UserWithAttributes>
synchroniseAllUsers
(DirectoryCache directoryCache) 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).protected void
synchroniseMemberships
(Collection<G> remoteGroups, DirectoryCache directoryCache, boolean isFullSync) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.crowd.directory.synchronisation.cache.CacheRefresher
synchroniseChanges
-
Field Details
-
remoteDirectory
-
-
Constructor Details
-
AbstractCacheRefresher
-
-
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 interfaceCacheRefresher
- 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 insynchroniseAll(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 insynchroniseAll(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() -
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
-