Interface InternalRemoteDirectory
- All Superinterfaces:
Attributes
,FastEntityCountProvider
,MultiValuesQueriesSupport
,RemoteDirectory
- All Known Implementing Classes:
AbstractInternalDirectory
,CachingDirectory
,InternalDirectory
,InternalDirectoryForDelegation
RemoteDirectory
that is used by InternalDirectories.
In particular, the findUserByName(String)
and findGroupByName(String)
have been redefined to return
TimestampedUser
and InternalDirectoryGroup
. The InternalDirectoryGroup
allows clients to
determine whether the group is "local".
-
Method Summary
Modifier and TypeMethodDescriptionaddAllGroups
(Set<GroupTemplate> groups) Adds a collection of groups to the directory.addAllGroupsToGroup
(Collection<String> childGroupNames, String groupName) Adds a collection of child groups to a group.Adds a collection of users to the directory.addAllUsersToGroup
(Set<String> userNames, String groupName) Adds a collection of users to a group.addLocalGroup
(GroupTemplate group) Adds a "local" group to the directory.addUserToGroups
(String username, Set<String> groupNames) Adds a user to many groups.findGroupByName
(String name) Finds thegroup
that matches the suppliedname
.findUserByExternalId
(String externalId) Finds the user that matches the suppliedexternalId
.findUserByName
(String name) Finds theuser
that matches the suppliedname
.forceRenameUser
(User oldUser, String newName) Forces a rename on the given user in this directory.Retrieves all users externalIds found in this directory.boolean
Returnstrue
if user active status is updated independently in the Crowd cache and the remote directory.removeAllGroups
(Set<String> groupNames) Removes all groups from the directory.removeAllUsers
(Set<String> usernames) Removes all users from the directory.removeGroupsFromGroup
(Collection<String> childGroupNames, String groupName) Removes a collection of child groups from a group.removeUsersFromGroup
(Set<String> usernames, String groupName) Removes a collection of users from a group.Methods inherited from interface com.atlassian.crowd.embedded.api.Attributes
getKeys, getValue, getValues, isEmpty
Methods inherited from interface com.atlassian.crowd.directory.FastEntityCountProvider
getGroupCount, getUserCount
Methods inherited from interface com.atlassian.crowd.directory.MultiValuesQueriesSupport
searchGroupRelationships, searchGroupRelationshipsGroupedByName
Methods inherited from interface com.atlassian.crowd.directory.RemoteDirectory
addGroup, addGroupToGroup, addUser, addUser, addUserToGroup, authenticate, countDirectMembersOfGroup, expireAllPasswords, findGroupWithAttributesByName, findUserWithAttributesByName, getAuthoritativeDirectory, getDescriptiveName, getDirectoryId, getLocallyFilteredGroupNames, getMemberships, getUserAvatarByName, isGroupDirectGroupMember, isRolesDisabled, isUserDirectGroupMember, removeGroup, removeGroupAttributes, removeGroupFromGroup, removeUser, removeUserAttributes, removeUserFromGroup, renameGroup, renameUser, searchGroupRelationships, searchGroups, searchUsers, setAttributes, setDirectoryId, storeGroupAttributes, storeUserAttributes, supportsInactiveAccounts, supportsNestedGroups, supportsPasswordExpiration, supportsSettingEncryptedCredential, testConnection, updateGroup, updateUser, updateUserCredential, updateUserFromRemoteDirectory, userAuthenticated
-
Method Details
-
findUserByName
Description copied from interface:RemoteDirectory
Finds theuser
that matches the suppliedname
.- Specified by:
findUserByName
in interfaceRemoteDirectory
- Parameters:
name
- the name of the user (username).- Returns:
TimestampedUser
entity.- Throws:
UserNotFoundException
- a user with the supplied name does not exist.
-
findUserByExternalId
Description copied from interface:RemoteDirectory
Finds the user that matches the suppliedexternalId
. This is an optional method that may not be implemented on all directory types. Currently it is implemented for LDAP and Internal directories but not Crowd directories.- Specified by:
findUserByExternalId
in interfaceRemoteDirectory
- Parameters:
externalId
- the externalId of the user- Returns:
TimestampedUser
entity.- Throws:
UserNotFoundException
- a user with the supplied externalId does not exist.- See Also:
-
findGroupByName
Description copied from interface:RemoteDirectory
Finds thegroup
that matches the suppliedname
.- Specified by:
findGroupByName
in interfaceRemoteDirectory
- Parameters:
name
- the name of the group.- Returns:
InternalDirectoryGroup
entity.- Throws:
GroupNotFoundException
- a group with the supplied name does not exist.
-
addLocalGroup
Adds a "local" group to the directory.This method can be used to store groups that aren't clones of "external" groups. For example, if an LDAP directory is cloned in an internal directory, it's possible to define "local" groups that exist internally but not in LDAP.
This functionality was added to meet the functionality that Confluence provided.
- Parameters:
group
- template of the group to add.- Returns:
- the added group retrieved from the underlying store.
- Throws:
InvalidGroupException
- The supplied group is invalid.OperationFailedException
- underlying directory implementation failed to execute the operation.
-
addAllUsers
Adds a collection of users to the directory.The bulk adding of users may be significantly faster than adding users one-by-one for large collections.
Caller must ensure that the users don't already exist.
- Parameters:
users
- templates of users to add.- Returns:
- result containing both successful and failed users
- Throws:
IllegalArgumentException
- if any of the users' directory ID does not match the directory's ID.
-
addAllGroups
Adds a collection of groups to the directory.The bulk adding of groups may be significantly faster than adding groups one-by-one for large collections.
Caller must ensure that the users don't already exist.
- Parameters:
groups
- templates of groups to add.- Returns:
- result containing both successful and failed groups
- Throws:
IllegalArgumentException
- if any of the groups' directory ID does not match the directory's ID.
-
addAllUsersToGroup
BatchResult<String> addAllUsersToGroup(Set<String> userNames, String groupName) throws GroupNotFoundException Adds a collection of users to a group.Caller must ensure that the memberships don't already exist.
- Parameters:
userNames
- names of users to add to group.groupName
- name of group to add users to.- Returns:
- result containing both successful and failed users
- Throws:
GroupNotFoundException
- group with suppliedgroupName
does not exist.
-
removeAllUsers
Removes all users from the directory.If a user with the supplied username does not exist in the directory, the username will be ignored.
- Parameters:
usernames
- usernames of users to remove.- Returns:
- batch result containing successes (removed users) and failures (users which were not removed)
-
removeAllGroups
Removes all groups from the directory.If a group with the supplied group name does not exist in the directory, the group name will be ignored.
- Parameters:
groupNames
- names of groups to remove.- Returns:
- batch result containing successes (removed groups) and failures (groups which were not removed)
-
isLocalUserStatusEnabled
boolean isLocalUserStatusEnabled()Returnstrue
if user active status is updated independently in the Crowd cache and the remote directory. Otherwise, user status is synchronised between the cache and the remote directory.- Returns:
true
if user status in the cache is updated independently of the remote directory.
-
forceRenameUser
Forces a rename on the given user in this directory. This works likeRemoteDirectory.renameUser(String, String)
, except it will still do the rename even if there is an existing user under the newName. In this case, it will first rename that existing user to a name that is known not to exist in this directory.- Parameters:
oldUser
- the existing user.newName
- desired name of user.- Returns:
- renamed user.
- Throws:
UserNotFoundException
- if the "oldUser" does not exist.- See Also:
-
getAllUserExternalIds
Retrieves all users externalIds found in this directory.- Returns:
- set of all users externalIds
- Throws:
OperationFailedException
- underlying directory implementation failed to execute the operation.
-
addUserToGroups
BatchResult<String> addUserToGroups(String username, Set<String> groupNames) throws UserNotFoundException Adds a user to many groups.This method assumes that user and groups already exist in the directory.
- Parameters:
username
- username of the user to whom we add groupsgroupNames
- names of the groups- Returns:
- result of the bulk operation containing successful and failed entities
- Throws:
UserNotFoundException
- when user with a givenusername
does not exist
-
removeUsersFromGroup
@ExperimentalApi BatchResult<String> removeUsersFromGroup(Set<String> usernames, String groupName) throws GroupNotFoundException, OperationFailedException Removes a collection of users from a group.- Parameters:
usernames
- names of users to remove from group.groupName
- name of group to remove users from.- Returns:
- result containing both successful and failed users
- Throws:
GroupNotFoundException
- group with suppliedgroupName
does not existOperationFailedException
- underlying directory implementation failed to execute the operation.- Since:
- 5.0.4
-
addAllGroupsToGroup
@ExperimentalApi BatchResult<String> addAllGroupsToGroup(Collection<String> childGroupNames, String groupName) throws GroupNotFoundException Adds a collection of child groups to a group.Caller must ensure that the memberships don't already exist.
- Parameters:
childGroupNames
- names of child groups to add to group.groupName
- name of group to add child groups to.- Returns:
- result containing both successful and failed child groups
- Throws:
GroupNotFoundException
- group with suppliedgroupName
cannot be found.- Since:
- 5.0.4
-
removeGroupsFromGroup
@ExperimentalApi BatchResult<String> removeGroupsFromGroup(Collection<String> childGroupNames, String groupName) throws GroupNotFoundException, OperationFailedException Removes a collection of child groups from a group.- Parameters:
childGroupNames
- names of child groups to remove from group.groupName
- name of group to remove child groups from.- Returns:
- result containing both successful and failed child groups
- Throws:
GroupNotFoundException
- group with suppliedgroupName
cannot be found.OperationFailedException
- underlying directory implementation failed to execute the operation.- Since:
- 5.0.4
-