Package com.atlassian.crowd.directory
Class DirectoryCacheImplUsingChangeOperations
java.lang.Object
com.atlassian.crowd.directory.DirectoryCacheImplUsingChangeOperations
- All Implemented Interfaces:
DirectoryCache
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddGroupMembersForGroup(Group parentGroup, Set<String> remoteGroups) voidaddGroupToGroup(String childGroup, String parentGroup) voidaddOrUpdateCachedGroup(Group group) voidaddOrUpdateCachedGroups(Collection<? extends Group> remoteGroups, Date syncStartDate) voidaddOrUpdateCachedUser(User user) addOrUpdateCachedUsers(Collection<? extends User> remoteUsers, Date syncStartDate) Synchronises a list of Users from an external directory in the local cache.voidaddUserMembersForGroup(Group parentGroup, Set<String> remoteUsers) voidaddUserToGroup(String username, String groupName) voidapplySyncingGroupAttributes(String groupName, Set<String> deletedAttributes, Map<String, Set<String>> storedAttributes) Removes any syncing group attributes listed in deletedAttributes, and store any that are listed in storedAttributes If any non-syncing attributes are included, they will be ignoredvoidapplySyncingUserAttributes(String userName, Set<String> deletedAttributes, Map<String, Set<String>> storedAttributes) Removes any syncing user attributes listed in deletedAttributes, and store any that are listed in storedAttributes If any non-syncing attributes are included, they will be ignoredvoiddeleteCachedGroup(String groupName) voiddeleteCachedGroups(Set<String> groupnames) voiddeleteCachedGroupsByGuids(Set<String> guids) voiddeleteCachedGroupsNotIn(GroupType groupType, List<? extends Group> remoteGroups, Date syncStartDate) voiddeleteCachedGroupsNotInByExternalId(Collection<? extends Group> remoteGroups, Date syncStartDate) voiddeleteCachedUser(String username) voiddeleteCachedUsersByGuid(Set<String> guids) voiddeleteCachedUsersNotIn(Collection<? extends User> users, Date syncStartDate) voiddeleteGroupMembersForGroup(Group parentGroup, Set<String> remoteGroups) voiddeleteUserMembersForGroup(Group parentGroup, Set<String> remoteUsers) findGroupsByExternalIds(Set<String> externalIds) Searches the specified directory for group names of groups with the specified external idsfindGroupsExternalIdsByNames(Set<String> groupNames) Searches the specified directory for externalIds of groups with the specified namesfindUsersByExternalIds(Set<String> externalIds) Searches the specified directory for user names of users with the specified external ids, returns a map from external id to usernameReturns a set of all group guids present in the cache excluding null values.Returns a set of all local group names.Returns a set of all user guids present in the cache excluding null values.longCounts external cached groups in the directory cachelongCounts groups in directory cache.longCounts users in directory cache.voidremoveGroupFromGroup(String childGroup, String parentGroup) voidremoveUserFromGroup(String username, String groupName) voidsyncGroupMembersForGroup(Group parentGroup, Collection<String> remoteGroups) voidsyncGroupMembershipsAndMembersForGroup(String groupName, Set<String> parentGroupNames, Set<String> childGroupNames) voidsyncGroupMembershipsForUser(String childUsername, Set<String> parentGroupNames) voidsyncUserMembersForGroup(Group parentGroup, Collection<String> remoteUsers)
-
Constructor Details
-
DirectoryCacheImplUsingChangeOperations
-
-
Method Details
-
addOrUpdateCachedUsers
public AddUpdateSets<UserTemplateWithCredentialAndAttributes,UserTemplate> addOrUpdateCachedUsers(Collection<? extends User> remoteUsers, Date syncStartDate) throws OperationFailedException Description copied from interface:DirectoryCacheSynchronises a list of Users from an external directory in the local cache.If the syncStartDate is not null, then it is used to ensure we don't re-introduce stale data if a User is updated locally after we did our search. Some callers may intentionally choose to pass null - eg when
com.atlassian.crowd.directory.ldap.cache.UsnChangedCacheRefresherdoes a partial synchronise.- Specified by:
addOrUpdateCachedUsersin interfaceDirectoryCache- Parameters:
remoteUsers- A list of Users from the external directory.syncStartDate- The date that the synchronise started (can be null).- Throws:
OperationFailedException- If the Internal Directory throws a OperationFailedException - which seems unlikely.
-
deleteCachedUsersByGuid
- Specified by:
deleteCachedUsersByGuidin interfaceDirectoryCache- Throws:
OperationFailedException
-
addOrUpdateCachedGroups
public void addOrUpdateCachedGroups(Collection<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException - Specified by:
addOrUpdateCachedGroupsin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteCachedGroupsNotIn
public void deleteCachedGroupsNotIn(GroupType groupType, List<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException - Specified by:
deleteCachedGroupsNotInin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteCachedGroupsNotInByExternalId
public void deleteCachedGroupsNotInByExternalId(Collection<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException - Specified by:
deleteCachedGroupsNotInByExternalIdin interfaceDirectoryCache- Throws:
OperationFailedException
-
syncUserMembersForGroup
public void syncUserMembersForGroup(Group parentGroup, Collection<String> remoteUsers) throws OperationFailedException - Specified by:
syncUserMembersForGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
addUserMembersForGroup
public void addUserMembersForGroup(Group parentGroup, Set<String> remoteUsers) throws OperationFailedException - Specified by:
addUserMembersForGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteUserMembersForGroup
public void deleteUserMembersForGroup(Group parentGroup, Set<String> remoteUsers) throws OperationFailedException - Specified by:
deleteUserMembersForGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
syncGroupMembersForGroup
public void syncGroupMembersForGroup(Group parentGroup, Collection<String> remoteGroups) throws OperationFailedException - Specified by:
syncGroupMembersForGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
addGroupMembersForGroup
public void addGroupMembersForGroup(Group parentGroup, Set<String> remoteGroups) throws OperationFailedException - Specified by:
addGroupMembersForGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteGroupMembersForGroup
public void deleteGroupMembersForGroup(Group parentGroup, Set<String> remoteGroups) throws OperationFailedException - Specified by:
deleteGroupMembersForGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteCachedGroups
- Specified by:
deleteCachedGroupsin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteCachedGroupsByGuids
- Specified by:
deleteCachedGroupsByGuidsin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteCachedUsersNotIn
public void deleteCachedUsersNotIn(Collection<? extends User> users, Date syncStartDate) throws OperationFailedException - Specified by:
deleteCachedUsersNotInin interfaceDirectoryCache- Throws:
OperationFailedException
-
addOrUpdateCachedUser
- Specified by:
addOrUpdateCachedUserin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteCachedUser
- Specified by:
deleteCachedUserin interfaceDirectoryCache- Throws:
OperationFailedException
-
addOrUpdateCachedGroup
- Specified by:
addOrUpdateCachedGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
deleteCachedGroup
- Specified by:
deleteCachedGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
addUserToGroup
- Specified by:
addUserToGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
removeUserFromGroup
- Specified by:
removeUserFromGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
addGroupToGroup
- Specified by:
addGroupToGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
removeGroupFromGroup
public void removeGroupFromGroup(String childGroup, String parentGroup) throws OperationFailedException - Specified by:
removeGroupFromGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
syncGroupMembershipsForUser
public void syncGroupMembershipsForUser(String childUsername, Set<String> parentGroupNames) throws OperationFailedException - Specified by:
syncGroupMembershipsForUserin interfaceDirectoryCache- Throws:
OperationFailedException
-
syncGroupMembershipsAndMembersForGroup
public void syncGroupMembershipsAndMembersForGroup(String groupName, Set<String> parentGroupNames, Set<String> childGroupNames) throws OperationFailedException - Specified by:
syncGroupMembershipsAndMembersForGroupin interfaceDirectoryCache- Throws:
OperationFailedException
-
getAllUserGuids
Description copied from interface:DirectoryCacheReturns a set of all user guids present in the cache excluding null values.- Specified by:
getAllUserGuidsin interfaceDirectoryCache- Returns:
- set of all user guids present in the cache
- Throws:
OperationFailedException- if the internal directory throes a OperationFailedException
-
getAllGroupGuids
Description copied from interface:DirectoryCacheReturns a set of all group guids present in the cache excluding null values.- Specified by:
getAllGroupGuidsin interfaceDirectoryCache- Returns:
- set of all group guids present in the cache
- Throws:
OperationFailedException- if the internal directory throes a OperationFailedException
-
getAllLocalGroupNames
Description copied from interface:DirectoryCacheReturns a set of all local group names.- Specified by:
getAllLocalGroupNamesin interfaceDirectoryCache- Returns:
- set of all local group names.
- Throws:
OperationFailedException- if the internal directory throes a OperationFailedException
-
getUserCount
Description copied from interface:DirectoryCacheCounts users in directory cache.- Specified by:
getUserCountin interfaceDirectoryCache- Returns:
- user count
- Throws:
OperationFailedException
-
getGroupCount
Description copied from interface:DirectoryCacheCounts groups in directory cache.- Specified by:
getGroupCountin interfaceDirectoryCache- Returns:
- group count
- Throws:
OperationFailedException
-
getExternalCachedGroupCount
Description copied from interface:DirectoryCacheCounts external cached groups in the directory cache- Specified by:
getExternalCachedGroupCountin interfaceDirectoryCache- Returns:
- external cached group count
- Throws:
OperationFailedException- if the internal directory throws a OperationFailedException
-
findUserWithAttributesByName
public UserWithAttributes findUserWithAttributesByName(String name) throws UserNotFoundException, OperationFailedException - Specified by:
findUserWithAttributesByNamein interfaceDirectoryCache- Throws:
UserNotFoundExceptionOperationFailedException
-
findUsersByExternalIds
Description copied from interface:DirectoryCacheSearches the specified directory for user names of users with the specified external ids, returns a map from external id to username- Specified by:
findUsersByExternalIdsin interfaceDirectoryCache- Parameters:
externalIds- the external ids of the users to search for
-
findGroupsByExternalIds
public Map<String,String> findGroupsByExternalIds(Set<String> externalIds) throws OperationFailedException Description copied from interface:DirectoryCacheSearches the specified directory for group names of groups with the specified external ids- Specified by:
findGroupsByExternalIdsin interfaceDirectoryCache- Parameters:
externalIds- external ids of the groups to find- Returns:
- a map from external ids to group names
- Throws:
OperationFailedException
-
findGroupsExternalIdsByNames
public Map<String,String> findGroupsExternalIdsByNames(Set<String> groupNames) throws OperationFailedException Description copied from interface:DirectoryCacheSearches the specified directory for externalIds of groups with the specified names- Specified by:
findGroupsExternalIdsByNamesin interfaceDirectoryCache- Parameters:
groupNames- names of the groups to find- Returns:
- a map from group names to external ids
- Throws:
OperationFailedException
-
findGroupWithAttributesByName
public GroupWithAttributes findGroupWithAttributesByName(String name) throws GroupNotFoundException, OperationFailedException - Specified by:
findGroupWithAttributesByNamein interfaceDirectoryCache- Throws:
GroupNotFoundExceptionOperationFailedException
-
applySyncingUserAttributes
public void applySyncingUserAttributes(String userName, Set<String> deletedAttributes, Map<String, Set<String>> storedAttributes) throws UserNotFoundException, OperationFailedExceptionDescription copied from interface:DirectoryCacheRemoves any syncing user attributes listed in deletedAttributes, and store any that are listed in storedAttributes If any non-syncing attributes are included, they will be ignored- Specified by:
applySyncingUserAttributesin interfaceDirectoryCache- Parameters:
userName- user to apply attributes todeletedAttributes- attribute keys that need to be deletedstoredAttributes- attributes and values that need to be saved (will overwrite any existing attributes with the same keys)- Throws:
UserNotFoundExceptionOperationFailedException
-
applySyncingGroupAttributes
public void applySyncingGroupAttributes(String groupName, Set<String> deletedAttributes, Map<String, Set<String>> storedAttributes) throws GroupNotFoundException, OperationFailedExceptionDescription copied from interface:DirectoryCacheRemoves any syncing group attributes listed in deletedAttributes, and store any that are listed in storedAttributes If any non-syncing attributes are included, they will be ignored- Specified by:
applySyncingGroupAttributesin interfaceDirectoryCache- Parameters:
groupName- group to apply attributes todeletedAttributes- attribute keys that need to be deletedstoredAttributes- attributes and values that need to be saved (will overwrite any existing attributes with the same keys)- Throws:
GroupNotFoundExceptionOperationFailedException
-