public class DbCachingRemoteChangeOperations extends Object implements DirectoryCacheChangeOperations
DirectoryCacheChangeOperations.AddRemoveSets<T>, DirectoryCacheChangeOperations.GroupShadowingType, DirectoryCacheChangeOperations.GroupsToAddUpdateReplace| Constructor and Description |
|---|
DbCachingRemoteChangeOperations(DirectoryDao directoryDao,
RemoteDirectory remoteDirectory,
InternalRemoteDirectory internalDirectory,
SynchronisationStatusManager synchronisationStatusManager,
MultiEventPublisher eventPublisher,
UserDao userDao,
GroupDao groupDao,
GroupActionStrategy groupActionStrategy,
CrowdDarkFeatureManager crowdDarkFeatureManager) |
| Modifier and Type | Method and Description |
|---|---|
void |
addGroupMembershipsForGroup(Group parentGroup,
Collection<String> groupsToAdd) |
void |
addGroups(Set<GroupTemplate> groupsToAdd) |
void |
addGroupToGroup(String childGroup,
String parentGroup) |
void |
addOrUpdateCachedGroup(Group group) |
void |
addOrUpdateCachedUser(User user) |
void |
addUserMembershipsForGroup(Group group,
Set<String> usersToAdd) |
void |
addUsers(Set<UserTemplateWithCredentialAndAttributes> usersToAdd) |
void |
addUserToGroup(String username,
String groupName) |
void |
applySyncingGroupAttributes(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 ignored
|
void |
applySyncingUserAttributes(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 ignored
|
void |
deleteCachedGroup(String groupName) |
void |
deleteCachedGroups(Set<String> groupnames) |
void |
deleteCachedGroupsByGuids(Set<String> guids) |
void |
deleteCachedGroupsNotIn(GroupType groupType,
List<? extends Group> remoteGroups,
Date syncStartDate) |
void |
deleteCachedGroupsNotInByExternalId(Collection<? extends Group> remoteGroups,
Date syncStartDate) |
void |
deleteCachedUser(String username) |
void |
deleteCachedUsersByGuid(Set<String> guids) |
void |
deleteCachedUsersNotIn(Collection<? extends User> remoteUsers,
Date synchStartDate) |
void |
deleteCachedUsersNotInOld(Collection<? extends User> remoteUsers,
Date synchStartDate) |
DirectoryCacheChangeOperations.AddRemoveSets<String> |
findGroupMembershipForGroupChanges(Group parentGroup,
Collection<String> remoteGroups) |
Map<String,String> |
findGroupsByExternalIds(Set<String> externalIds)
Searches the specified directory for group names of groups with the specified external ids
|
Map<String,String> |
findGroupsExternalIdsByNames(Set<String> groupNames)
Searches the specified directory for externalIds of groups with the specified names
|
DirectoryCacheChangeOperations.GroupsToAddUpdateReplace |
findGroupsToUpdate(Collection<? extends Group> remoteGroups,
Date syncStartDate) |
GroupWithAttributes |
findGroupWithAttributesByName(String name) |
DirectoryCacheChangeOperations.AddRemoveSets<String> |
findUserMembershipForGroupChanges(Group group,
Collection<String> remoteUsers) |
Map<String,String> |
findUsersByExternalIds(Set<String> externalIds) |
UserWithAttributes |
findUserWithAttributesByName(String name) |
Set<String> |
getAllGroupGuids() |
Set<String> |
getAllLocalGroupNames() |
Set<String> |
getAllUserGuids() |
protected Directory |
getDirectory() |
long |
getExternalCachedGroupCount() |
long |
getGroupCount() |
protected static Optional<Long> |
getLastSyncStartOrEnd(DirectorySynchronisationInformation syncInfo) |
long |
getUserCount() |
AddUpdateSets<UserTemplateWithCredentialAndAttributes,UserTemplate> |
getUsersToAddAndUpdate(Collection<? extends User> remoteUsers,
Date syncStartDate)
Returns the users that need to be added or updated given the list of all remote users.
|
AddUpdateSets<UserTemplateWithCredentialAndAttributes,UserTemplate> |
getUsersToAddAndUpdateOld(Collection<? extends User> remoteUsers,
Date syncStartDate) |
protected boolean |
hasChanged(User remoteUser,
User internalUser) |
DirectoryCacheChangeOperations.GroupShadowingType |
isGroupShadowed(Group remoteGroup)
Returns true if the given remote Group should not have its memberships synchronised for any reason.
|
protected static Map<String,TimestampedUser> |
mapUsersByExternalId(Collection<TimestampedUser> users) |
protected static List<org.apache.commons.lang3.tuple.Pair<User,TimestampedUser>> |
matchUsers(Collection<? extends User> remoteUsers,
Collection<? extends TimestampedUser> internalUsers)
Returns list of
Pair, where Pair.getLeft() is one of remoteUsers and
Pair.getRight() is a matched internalUsers or null, if not matched. |
void |
removeGroupFromGroup(String childGroup,
String parentGroup) |
void |
removeGroupMembershipsForGroup(Group parentGroup,
Collection<String> groupsToRemove) |
void |
removeGroups(Collection<String> groupsToRemove) |
void |
removeUserFromGroup(String username,
String groupName) |
void |
removeUserMembershipsForGroup(Group group,
Set<String> usersToRemove) |
void |
syncGroupMembershipsAndMembersForGroup(String groupName,
Set<String> parentGroupNames,
Set<String> childGroupNames) |
void |
syncGroupMembershipsForUser(String childUsername,
Set<String> parentGroupNames) |
void |
updateGroups(Collection<GroupTemplate> groupsToUpdate) |
void |
updateUsers(Collection<UserTemplate> usersToUpdate) |
public DbCachingRemoteChangeOperations(DirectoryDao directoryDao, RemoteDirectory remoteDirectory, InternalRemoteDirectory internalDirectory, SynchronisationStatusManager synchronisationStatusManager, MultiEventPublisher eventPublisher, UserDao userDao, GroupDao groupDao, GroupActionStrategy groupActionStrategy, CrowdDarkFeatureManager crowdDarkFeatureManager)
public void addUsers(Set<UserTemplateWithCredentialAndAttributes> usersToAdd) throws OperationFailedException
addUsers in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void updateUsers(Collection<UserTemplate> usersToUpdate) throws OperationFailedException
updateUsers in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedUsersByGuid(Set<String> guids) throws OperationFailedException
deleteCachedUsersByGuid in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedUsersNotIn(Collection<? extends User> remoteUsers, Date synchStartDate) throws OperationFailedException
deleteCachedUsersNotIn in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedUsersNotInOld(Collection<? extends User> remoteUsers, Date synchStartDate) throws OperationFailedException
OperationFailedExceptionpublic DirectoryCacheChangeOperations.GroupsToAddUpdateReplace findGroupsToUpdate(Collection<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException
findGroupsToUpdate in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void removeGroups(Collection<String> groupsToRemove) throws OperationFailedException
removeGroups in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void addGroups(Set<GroupTemplate> groupsToAdd) throws OperationFailedException
addGroups in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void updateGroups(Collection<GroupTemplate> groupsToUpdate) throws OperationFailedException
updateGroups in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedGroupsNotIn(GroupType groupType, List<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException
deleteCachedGroupsNotIn in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedGroupsNotInByExternalId(Collection<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException
deleteCachedGroupsNotInByExternalId in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedGroups(Set<String> groupnames) throws OperationFailedException
deleteCachedGroups in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedGroupsByGuids(Set<String> guids) throws OperationFailedException
deleteCachedGroupsByGuids in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic DirectoryCacheChangeOperations.AddRemoveSets<String> findUserMembershipForGroupChanges(Group group, Collection<String> remoteUsers) throws OperationFailedException
findUserMembershipForGroupChanges in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void removeUserMembershipsForGroup(Group group, Set<String> usersToRemove) throws OperationFailedException
removeUserMembershipsForGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void addUserMembershipsForGroup(Group group, Set<String> usersToAdd) throws OperationFailedException
addUserMembershipsForGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic DirectoryCacheChangeOperations.AddRemoveSets<String> findGroupMembershipForGroupChanges(Group parentGroup, Collection<String> remoteGroups) throws OperationFailedException
findGroupMembershipForGroupChanges in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void addGroupMembershipsForGroup(Group parentGroup, Collection<String> groupsToAdd) throws OperationFailedException
addGroupMembershipsForGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void removeGroupMembershipsForGroup(Group parentGroup, Collection<String> groupsToRemove) throws OperationFailedException
removeGroupMembershipsForGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionprotected static Optional<Long> getLastSyncStartOrEnd(DirectorySynchronisationInformation syncInfo)
protected Directory getDirectory() throws DirectoryNotFoundException
DirectoryNotFoundExceptionpublic DirectoryCacheChangeOperations.GroupShadowingType isGroupShadowed(Group remoteGroup) throws OperationFailedException
isGroupShadowed in interface DirectoryCacheChangeOperationsremoteGroup - The Group to test.OperationFailedException - If there is an error trying to find the group in the Internal Directory (should not occur).public AddUpdateSets<UserTemplateWithCredentialAndAttributes,UserTemplate> getUsersToAddAndUpdate(Collection<? extends User> remoteUsers, Date syncStartDate) throws OperationFailedException
getUsersToAddAndUpdate in interface DirectoryCacheChangeOperationsremoteUsers - List of all remote users.syncStartDate - Date and time of the start of the synchronisation. Used to determine which users need to be
synchronised. Can be null in which case all the users are synchronised.OperationFailedException - if the operation failed for any reasonprotected static List<org.apache.commons.lang3.tuple.Pair<User,TimestampedUser>> matchUsers(Collection<? extends User> remoteUsers, Collection<? extends TimestampedUser> internalUsers)
Pair, where Pair.getLeft() is one of remoteUsers and
Pair.getRight() is a matched internalUsers or null, if not matched.public AddUpdateSets<UserTemplateWithCredentialAndAttributes,UserTemplate> getUsersToAddAndUpdateOld(Collection<? extends User> remoteUsers, Date syncStartDate) throws OperationFailedException
OperationFailedExceptionprotected static Map<String,TimestampedUser> mapUsersByExternalId(Collection<TimestampedUser> users)
public void addOrUpdateCachedUser(User user) throws OperationFailedException
addOrUpdateCachedUser in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedUser(String username) throws OperationFailedException
deleteCachedUser in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void addOrUpdateCachedGroup(Group group) throws OperationFailedException
addOrUpdateCachedGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void deleteCachedGroup(String groupName) throws OperationFailedException
deleteCachedGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void addUserToGroup(String username, String groupName) throws OperationFailedException
addUserToGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void addGroupToGroup(String childGroup, String parentGroup) throws OperationFailedException
addGroupToGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void removeUserFromGroup(String username, String groupName) throws OperationFailedException
removeUserFromGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void removeGroupFromGroup(String childGroup, String parentGroup) throws OperationFailedException
removeGroupFromGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void syncGroupMembershipsForUser(String childUsername, Set<String> parentGroupNames) throws OperationFailedException
syncGroupMembershipsForUser in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic void syncGroupMembershipsAndMembersForGroup(String groupName, Set<String> parentGroupNames, Set<String> childGroupNames) throws OperationFailedException
syncGroupMembershipsAndMembersForGroup in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic UserWithAttributes findUserWithAttributesByName(String name) throws UserNotFoundException, OperationFailedException
findUserWithAttributesByName in interface DirectoryCacheChangeOperationsUserNotFoundExceptionOperationFailedExceptionpublic GroupWithAttributes findGroupWithAttributesByName(String name) throws GroupNotFoundException, OperationFailedException
findGroupWithAttributesByName in interface DirectoryCacheChangeOperationsGroupNotFoundExceptionOperationFailedExceptionpublic Map<String,String> findUsersByExternalIds(Set<String> externalIds)
findUsersByExternalIds in interface DirectoryCacheChangeOperationspublic Map<String,String> findGroupsByExternalIds(Set<String> externalIds) throws OperationFailedException
DirectoryCacheChangeOperationsfindGroupsByExternalIds in interface DirectoryCacheChangeOperationsexternalIds - external ids of the groups to findOperationFailedExceptionpublic Map<String,String> findGroupsExternalIdsByNames(Set<String> groupNames) throws OperationFailedException
DirectoryCacheChangeOperationsfindGroupsExternalIdsByNames in interface DirectoryCacheChangeOperationsgroupNames - names of the groups to findOperationFailedExceptionpublic void applySyncingUserAttributes(String userName, Set<String> deletedAttributes, Map<String,Set<String>> storedAttributes) throws UserNotFoundException, OperationFailedException
DirectoryCacheChangeOperationsapplySyncingUserAttributes in interface DirectoryCacheChangeOperationsuserName - 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)UserNotFoundExceptionOperationFailedExceptionpublic void applySyncingGroupAttributes(String groupName, Set<String> deletedAttributes, Map<String,Set<String>> storedAttributes) throws GroupNotFoundException, OperationFailedException
DirectoryCacheChangeOperationsapplySyncingGroupAttributes in interface DirectoryCacheChangeOperationsgroupName - 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)GroupNotFoundExceptionOperationFailedExceptionpublic Set<String> getAllUserGuids() throws OperationFailedException
getAllUserGuids in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic Set<String> getAllGroupGuids() throws OperationFailedException
getAllGroupGuids in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic long getUserCount()
throws OperationFailedException
getUserCount in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic long getGroupCount()
throws OperationFailedException
getGroupCount in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic long getExternalCachedGroupCount()
throws OperationFailedException
getExternalCachedGroupCount in interface DirectoryCacheChangeOperationsOperationFailedExceptionpublic Set<String> getAllLocalGroupNames() throws OperationFailedException
getAllLocalGroupNames in interface DirectoryCacheChangeOperationsOperationFailedExceptionCopyright © 2024 Atlassian. All rights reserved.