public class DeltaQueryCacheRefresher extends Object implements CacheRefresher
If no delta tokens are present a full synchronisation using Azure AD's delta endpoints will be performed to obtain delta tokens for future incremental syncs.
As Azure AD returns a diff of group memberships, this cache refresher will add/remove the memberships specified by Azure AD instead of diffing current memberships with the ones obtained from the remote directory. This also causes a slight overhead due to the need to look up entity names for those memberships as Azure AD only specifies external ids and Crowd needs names. To facilitate this the names for added/changed entities are added into a cache local to a synchronisation and the cache is then populated whenever a lookup is performed.
This CacheRefresher uses worker threads for synchronisation. There are two reasons for this:
| Modifier and Type | Class and Description |
|---|---|
protected static interface |
DeltaQueryCacheRefresher.IdToNameProvider |
protected static interface |
DeltaQueryCacheRefresher.IdToNameResolver |
| Modifier and Type | Field and Description |
|---|---|
protected AzureAdDirectory |
azureAdDirectory |
| Constructor and Description |
|---|
DeltaQueryCacheRefresher(AzureAdDirectory remoteDirectory) |
protected final AzureAdDirectory azureAdDirectory
public DeltaQueryCacheRefresher(AzureAdDirectory remoteDirectory)
public CacheSynchronisationResult synchroniseAll(DirectoryCache directoryCache) throws com.atlassian.crowd.exception.OperationFailedException
synchroniseAll in interface CacheRefreshercom.atlassian.crowd.exception.OperationFailedExceptionprotected DeltaQueryResult<UserWithAttributes> getUsersFromDeltaQuery() throws com.atlassian.crowd.exception.OperationFailedException
protected DeltaQueryResult<UserWithAttributes> getUserChangesFromDeltaQuery(String userSyncToken) throws com.atlassian.crowd.exception.OperationFailedException
public CacheSynchronisationResult synchroniseChanges(DirectoryCache directoryCache, @Nullable String syncToken) throws com.atlassian.crowd.exception.OperationFailedException
synchroniseChanges in interface CacheRefreshercom.atlassian.crowd.exception.OperationFailedExceptionprotected Optional<DeltaQuerySyncTokenHolder> extractSyncToken(String syncToken)
protected boolean isValidToken(DeltaQuerySyncTokenHolder deltaQueryTokens)
protected void synchroniseMembershipChanges(DirectoryCache directoryCache, DeltaQueryResult<UserWithAttributes> mappedUsers, Collection<GroupWithMembershipChanges> mappedGroups) throws com.atlassian.crowd.exception.OperationFailedException
protected Set<String> getNames(Map<String,String> idToNameCache, Set<String> idsToResolve, DeltaQueryCacheRefresher.IdToNameProvider findById, boolean failOnNotResolved, String entityType) throws com.atlassian.crowd.exception.OperationFailedException
protected <T> Map<String,String> mapIdToUniqueNames(Collection<T> entities, Function<T,String> idMapper, Function<T,String> nameMapper, String entityName)
protected DeltaQueryCacheRefresher.IdToNameResolver usersResolver(DeltaQueryResult<UserWithAttributes> mappedUsers, DirectoryCache directoryCache)
protected DeltaQueryCacheRefresher.IdToNameResolver groupResolver(Collection<GroupWithMembershipChanges> mappedGroups, DirectoryCache directoryCache)
protected DeltaQueryResult<UserWithAttributes> synchroniseUserChanges(DirectoryCache directoryCache, DeltaQueryResult<UserWithAttributes> mappedUsers, Date syncStartDate) throws com.atlassian.crowd.exception.OperationFailedException
protected DeltaQueryResult<GroupWithMembershipChanges> synchroniseGroupChanges(DirectoryCache directoryCache, DeltaQueryResult<GroupWithMembershipChanges> mappedGroups, Date syncStartDate) throws com.atlassian.crowd.exception.OperationFailedException
protected void checkNoRenamedGroups(DirectoryCache directoryCache, DeltaQueryResult<GroupWithMembershipChanges> mappedGroups) throws com.atlassian.crowd.exception.OperationFailedException
protected void checkNoReaddedGroups(DirectoryCache directoryCache, DeltaQueryResult<GroupWithMembershipChanges> mappedGroups) throws com.atlassian.crowd.exception.OperationFailedException
protected <T> void handleNamelessEntities(DeltaQueryResult<T> mappedEntities, String entityType)
Copyright © 2023 Atlassian. All rights reserved.