public class DbCachingRemoteChangeOperations extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DirectoryCacheChangeOperations.AddRemoveSets<T> |
static class |
DirectoryCacheChangeOperations.AddUpdateSets<A,U> |
static class |
DirectoryCacheChangeOperations.GroupsToAddUpdateReplace |
| Constructor and Description |
|---|
DbCachingRemoteChangeOperations(com.atlassian.crowd.embedded.spi.DirectoryDao directoryDao,
RemoteDirectory remoteDirectory,
InternalRemoteDirectory internalDirectory,
SynchronisationStatusManager synchronisationStatusManager,
MultiEventPublisher eventPublisher) |
| 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 |
deleteCachedGroupsNotIn(GroupType groupType,
List<? extends Group> remoteGroups,
Date syncStartDate) |
void |
deleteCachedUser(String username) |
void |
deleteCachedUsersByGuid(Set<String> guids) |
void |
deleteCachedUsersNotIn(List<? extends User> remoteUsers,
Date synchStartDate) |
DirectoryCacheChangeOperations.AddRemoveSets<String> |
findGroupMembershipForGroupChanges(Group parentGroup,
Collection<String> remoteGroups) |
DirectoryCacheChangeOperations.GroupsToAddUpdateReplace |
findGroupsToUpdate(Collection<? extends Group> remoteGroups,
Date syncStartDate) |
GroupWithAttributes |
findGroupWithAttributesByName(String name) |
DirectoryCacheChangeOperations.AddRemoveSets<String> |
findUserMembershipForGroupChanges(Group group,
Collection<String> remoteUsers) |
UserWithAttributes |
findUserWithAttributesByName(String name) |
Set<String> |
getAllUserGuids() |
protected Directory |
getDirectory() |
long |
getUserCount() |
DirectoryCacheChangeOperations.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.
|
protected boolean |
hasChanged(User remoteUser,
User internalUser) |
boolean |
ignoreGroupOnSynchroniseMemberships(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) |
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(com.atlassian.crowd.embedded.spi.DirectoryDao directoryDao, RemoteDirectory remoteDirectory, InternalRemoteDirectory internalDirectory, SynchronisationStatusManager synchronisationStatusManager, MultiEventPublisher eventPublisher)
public void addUsers(Set<UserTemplateWithCredentialAndAttributes> usersToAdd) throws OperationFailedException
OperationFailedExceptionpublic void updateUsers(Collection<UserTemplate> usersToUpdate) throws OperationFailedException
OperationFailedExceptionpublic void deleteCachedUsersByGuid(Set<String> guids) throws OperationFailedException
OperationFailedExceptionpublic void deleteCachedUsersNotIn(List<? extends User> remoteUsers, Date synchStartDate) throws OperationFailedException
OperationFailedExceptionpublic DirectoryCacheChangeOperations.GroupsToAddUpdateReplace findGroupsToUpdate(Collection<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException
OperationFailedExceptionpublic void removeGroups(Collection<String> groupsToRemove) throws OperationFailedException
OperationFailedExceptionpublic void addGroups(Set<GroupTemplate> groupsToAdd) throws OperationFailedException
OperationFailedExceptionpublic void updateGroups(Collection<GroupTemplate> groupsToUpdate) throws OperationFailedException
OperationFailedExceptionpublic void deleteCachedGroupsNotIn(GroupType groupType, List<? extends Group> remoteGroups, Date syncStartDate) throws OperationFailedException
OperationFailedExceptionpublic void deleteCachedGroups(Set<String> groupnames) throws OperationFailedException
OperationFailedExceptionpublic DirectoryCacheChangeOperations.AddRemoveSets<String> findUserMembershipForGroupChanges(Group group, Collection<String> remoteUsers) throws OperationFailedException
OperationFailedExceptionpublic void removeUserMembershipsForGroup(Group group, Set<String> usersToRemove) throws OperationFailedException
OperationFailedExceptionpublic void addUserMembershipsForGroup(Group group, Set<String> usersToAdd) throws OperationFailedException
OperationFailedExceptionpublic DirectoryCacheChangeOperations.AddRemoveSets<String> findGroupMembershipForGroupChanges(Group parentGroup, Collection<String> remoteGroups) throws OperationFailedException
OperationFailedExceptionpublic void addGroupMembershipsForGroup(Group parentGroup, Collection<String> groupsToAdd) throws OperationFailedException
OperationFailedExceptionpublic void removeGroupMembershipsForGroup(Group parentGroup, Collection<String> groupsToRemove) throws OperationFailedException
OperationFailedExceptionprotected Directory getDirectory() throws DirectoryNotFoundException
DirectoryNotFoundExceptionpublic boolean ignoreGroupOnSynchroniseMemberships(Group remoteGroup) throws OperationFailedException
remoteGroup - The Group to test.OperationFailedException - If there is an error trying to find the group in the Internal Directory (should not occur).public DirectoryCacheChangeOperations.AddUpdateSets<UserTemplateWithCredentialAndAttributes,UserTemplate> getUsersToAddAndUpdate(Collection<? extends User> remoteUsers, Date syncStartDate) throws OperationFailedException
remoteUsers - 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 Map<String,TimestampedUser> mapUsersByExternalId(Collection<TimestampedUser> users)
public void addOrUpdateCachedUser(User user) throws OperationFailedException
OperationFailedExceptionpublic void deleteCachedUser(String username) throws OperationFailedException
OperationFailedExceptionpublic void addOrUpdateCachedGroup(Group group) throws OperationFailedException
OperationFailedExceptionpublic void deleteCachedGroup(String groupName) throws OperationFailedException
OperationFailedExceptionpublic void addUserToGroup(String username, String groupName) throws OperationFailedException
OperationFailedExceptionpublic void addGroupToGroup(String childGroup, String parentGroup) throws OperationFailedException
OperationFailedExceptionpublic void removeUserFromGroup(String username, String groupName) throws OperationFailedException
OperationFailedExceptionpublic void removeGroupFromGroup(String childGroup, String parentGroup) throws OperationFailedException
OperationFailedExceptionpublic void syncGroupMembershipsForUser(String childUsername, Set<String> parentGroupNames) throws OperationFailedException
OperationFailedExceptionpublic void syncGroupMembershipsAndMembersForGroup(String groupName, Set<String> parentGroupNames, Set<String> childGroupNames) throws OperationFailedException
OperationFailedExceptionpublic UserWithAttributes findUserWithAttributesByName(String name) throws UserNotFoundException, OperationFailedException
public GroupWithAttributes findGroupWithAttributesByName(String name) throws GroupNotFoundException, OperationFailedException
public void applySyncingUserAttributes(String userName, Set<String> deletedAttributes, Map<String,Set<String>> storedAttributes) throws UserNotFoundException, OperationFailedException
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)UserNotFoundExceptionOperationFailedExceptionpublic void applySyncingGroupAttributes(String groupName, Set<String> deletedAttributes, Map<String,Set<String>> storedAttributes) throws GroupNotFoundException, OperationFailedException
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)GroupNotFoundExceptionOperationFailedExceptionpublic Set<String> getAllUserGuids() throws OperationFailedException
OperationFailedExceptionpublic long getUserCount()
throws OperationFailedException
OperationFailedExceptionCopyright © 2018 Atlassian. All rights reserved.