public interface CrowdService
User.getDirectoryId() is ignored in all methods having User in the parameter list. Null parameters
for methods may throw NullPointerException or IllegalArgumentException.CrowdDirectoryService| Modifier and Type | Method and Description |
|---|---|
User |
activateUser(String email)
Will change the active state of an existing user to active
|
Group |
addGroup(Group group)
Adds a
group to the directory store. |
boolean |
addGroupToGroup(Group childGroup,
Group parentGroup)
Adds a group as a member of a parent group.
|
User |
addUser(User user,
String credential)
Adds a
user to the directory store. |
boolean |
addUserToGroup(User user,
Group group)
Adds a user as a member of a group.
|
User |
authenticate(String name,
String credential)
Authenticates a
user with the given credential. |
User |
authenticateLocalServiceDeskUser(String email,
String credential)
Authenticates a
user that is marked as service desk local with the given credential. |
User |
authenticateWithHostname(String name,
String credential,
String tenantHostname)
Authenticates a
user with the given credential and hostname. |
User |
deactivateUser(String email)
Will change the active state of an existing user to inactive
|
UserCapabilities |
getCapabilitiesForNewUsers()
Gets details of the possible operations that can be performed on
new users. |
Group |
getGroup(String name)
Finds the
group that matches the supplied name. |
GroupWithAttributes |
getGroupWithAttributes(String name)
Finds the
group that matches the supplied name. |
User |
getUser(String name)
Returns the
user that matches the supplied name. |
User |
getUserByAccountId(String accountId)
Returns the
user that matches the supplied Atlassian accountId. |
UserWithAttributes |
getUserWithAttributes(String name)
Returns the
user that matches the supplied name. |
User |
importUser(User user,
Map<String,Set<String>> attributes,
String requestingUser)
Creates a new user via the Identity Platform.
|
boolean |
isGroupDirectGroupMember(Group childGroup,
Group parentGroup)
Determines if a group is a direct member of another group.
|
boolean |
isGroupMemberOfGroup(Group childGroup,
Group parentGroup)
Returns
true if the childGroup is a direct or indirect (nested) member of the parentGroup. |
boolean |
isGroupMemberOfGroup(String childGroupName,
String parentGroupName)
Returns
true if childGroupName is a direct or indirect (nested) member of parentGroupName. |
boolean |
isIdentityPlatformEnabled()
This method exists to support the transition from Horde to Identity Platform.
|
boolean |
isUserDirectGroupMember(User user,
Group group)
Determines if a user is a direct member of a group.
|
boolean |
isUserMemberOfGroup(String userName,
String groupName)
Returns
true if the user is a direct or indirect (nested) member of the group. |
boolean |
isUserMemberOfGroup(User user,
Group group)
Returns
true if the user is a direct or indirect (nested) member of the group. |
void |
removeAllGroupAttributes(Group group)
Removes all group attributes.
|
void |
removeAllUserAttributes(User user)
Remove all attributes for a user.
|
boolean |
removeGroup(Group group)
Removes the
group that matches the supplied name. |
void |
removeGroupAttribute(Group group,
String attributeName)
Removes all the values for a single attribute key for a group.
|
boolean |
removeGroupFromGroup(Group childGroup,
Group parentGroup)
Removes a group as a member of a parent group.
|
boolean |
removeUser(User user)
Removes the
user that matches the supplied name. |
void |
removeUserAttribute(User user,
String attributeName)
Removes all the values for a single attribute key for a user.
|
boolean |
removeUserFromGroup(User user,
Group group)
Removes a user as a member of a group.
|
User |
renameUser(User user,
String newUsername)
Renames the
User. |
User |
requestAccess(User user,
Set<String> extraGroups,
Set<String> extraProducts,
Optional<String> invitationText,
Optional<String> continueUrl)
Adds a
user to the directory store. |
<T> Iterable<T> |
search(Query<T> query)
Searches for entities (e.g.
|
Iterable<User> |
searchUsersAllowingDuplicateNames(Query<User> query)
Deprecated.
this method violates the directory encapsulation of CrowdService and will be removed in
the future. Consumers of this method should move to a different service.
|
void |
setGroupAttribute(Group group,
String attributeName,
Set<String> attributeValues)
Adds or updates a group's attributes with the new
attributes. |
void |
setGroupAttribute(Group group,
String attributeName,
String attributeValue)
Adds or updates a group's attributes with the new attributes.
|
void |
setUserAttribute(User user,
String attributeName,
Set<String> attributeValues)
Adds or updates a user's attribute with the new attribute values.
|
void |
setUserAttribute(User user,
String attributeName,
String attributeValue)
Adds or updates a user's attribute with the new attribute value.
|
Group |
updateGroup(Group group)
Updates the
group. |
User |
updateUser(User user)
Updates the
User. |
void |
updateUserCredential(User user,
String credential)
|
boolean isIdentityPlatformEnabled()
User authenticate(String name, String credential) throws FailedAuthenticationException, OperationFailedException
user with the given credential.name - The name of the user (username).credential - The supplied credential to authenticate withFailedAuthenticationException - Authentication with the provided credentials failed. It may indicate that
the user does not exist or the user's account is inactive or the credentials are incorrectInactiveAccountException - The supplied user is inactive.ExpiredCredentialException - The user's credentials have expired. The user must change their credentials in order to successfully authenticate.AccountNotFoundException - User with the given name could not be foundOperationFailedException - underlying directory implementation failed to execute the operation.User authenticateWithHostname(String name, String credential, String tenantHostname) throws FailedAuthenticationException, OperationFailedException
user with the given credential and hostname.name - The name of the user (username).credential - The supplied credential to authenticate with.tenantHostname - The hostname of the instance.FailedAuthenticationException - Authentication with the provided credentials failed. It may indicate that
the user does not exist or the user's account is inactive or the credentials are incorrectOperationFailedException - underlying directory implementation failed to execute the operation.User authenticateLocalServiceDeskUser(String email, String credential) throws FailedAuthenticationException, OperationFailedException
user that is marked as service desk local with the given credential.
This method will fail with an AccountNotFoundException if the user is not marked as local, thus those users
are treated as if they didn't exist.email - The email of the user (username).credential - The supplied credential to authenticate withFailedAuthenticationException - Authentication with the provided credentials failed. It may indicate that
the user does not exist or the user's account is inactive or the credentials are incorrectInactiveAccountException - The supplied user is inactive.ExpiredCredentialException - The user's credentials have expired. The user must change their credentials in order to successfully authenticate.AccountNotFoundException - User with the given email could not be foundOperationFailedException - underlying directory implementation failed to execute the operation.User getUser(String name)
user that matches the supplied name.name - the name of the user (username). Does not allow null, blank or empty strings.null if the user is not foundUser getUserByAccountId(String accountId)
user that matches the supplied Atlassian accountId.accountId - the Atlassian account ID of the user (username). Does not allow null, blank or empty strings.null if the user is not foundUserWithAttributes getUserWithAttributes(String name)
user that matches the supplied name.name - the name of the user (username).null if the user is not foundGroup getGroup(String name)
group that matches the supplied name.name - the name of the group.null if not found.GroupWithAttributes getGroupWithAttributes(String name)
group that matches the supplied name.name - the name of the group.null if not found.boolean isUserMemberOfGroup(String userName, String groupName)
true if the user is a direct or indirect (nested) member of the group.userName - user to inspect.groupName - group to inspect.true if and only if the user is a direct or indirect (nested) member of the group.
If the user or group cannot found, then false is returned.isUserMemberOfGroup(User, Group)boolean isUserMemberOfGroup(User user, Group group)
true if the user is a direct or indirect (nested) member of the group.user - user to inspect.group - group to inspect.true if and only if the user is a direct or indirect (nested) member of the group, otherwise false.
If the user or group cannot found, then false is returned.isUserMemberOfGroup(String, String)boolean isGroupMemberOfGroup(String childGroupName, String parentGroupName)
true if childGroupName is a direct or indirect (nested) member of parentGroupName.childGroupName - name of child group to inspect.parentGroupName - name of parent group to inspect.true if and only if the childGroupName is a direct or indirect (nested) member of the parentGroupName.
If any of the groups cannot found, then false is returned.boolean isGroupMemberOfGroup(Group childGroup, Group parentGroup)
true if the childGroup is a direct or indirect (nested) member of the parentGroup.childGroup - group to inspect.parentGroup - group to inspect.true if and only if the childGroup is a direct or indirect (nested) member of the parentGroup.
If any of the groups cannot found, then false is returned.User addUser(User user, String credential) throws InvalidUserException, InvalidCredentialException, OperationNotPermittedException, OperationFailedException
user to the directory store. The user must have non-null names and email address.user - template of the user to add.credential - password. May not be null or blank.InvalidUserException - The supplied user's details are invalid and/or incomplete.InvalidCredentialException - The supplied credential is invalid, this may be due the credential not matching required directory constraints.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - if the operation failed for any other reasonUser requestAccess(User user, Set<String> extraGroups, Set<String> extraProducts, Optional<String> invitationText, Optional<String> continueUrl) throws OperationNotPermittedException
user to the directory store. The user must have non-null names and email address.
This endpoint will ensure the user has access, either by creating them if they do not exist or adding access to an
existing user.
The operation will only add access, and cannot remove it. It may also grant additional access to what is specified,
for example the instance configured default products.
Some fields in the User object may be used to construct a new user, but may be ignored if the user already exists (eg Display Name)user - template of the user to add. Primarily used for the email address/AaID of the userextraGroups - a set of group names to add the user to after creationextraProducts - a set of products to ensure the user has access to after creationinvitationText - custom text to send if the user needs to be invited. May be ignored if the user already existscontinueUrl - custom continue url to send as part of the invitation. May be ignored if the user already existsOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - if the operation failed for any other reasonUser activateUser(String email) throws OperationFailedException, OperationNotPermittedException
email - the email of the user to make activeOperationFailedExceptionOperationNotPermittedExceptionUser deactivateUser(String email) throws OperationFailedException, OperationNotPermittedException
email - the email of the user to make inactiveOperationFailedExceptionOperationNotPermittedExceptionUser importUser(User user, Map<String,Set<String>> attributes, String requestingUser) throws OperationNotPermittedException
user - A user template representing the user we would like to create.attributes - A map of user attributes for the user we would like to create.requestingUser - the Atlassian ID of the requesting user.user.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedUser updateUser(User user) throws UserNotFoundException, InvalidUserException, OperationNotPermittedException, OperationFailedException
User. The user must have non-null names and email address.user - The user to update.DirectoryUserNotFoundException - if the supplied user does not exist in the directory.InvalidUserException - The supplied user's details are invalid and/or incomplete.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.User renameUser(User user, String newUsername) throws UserNotFoundException, InvalidUserException, OperationNotPermittedException, OperationFailedException
User.user - user to rename.newUsername - new username of the renamed user.UserNotFoundException - if the supplied user does not exist.InvalidUserException - if the new username does not meet the username requirements for an associated directory.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performed.OperationFailedException - underlying directory implementation failed to execute the operation.UnsupportedOperationException - underlying directory implementation does not support user renaming.void updateUserCredential(User user, String credential) throws UserNotFoundException, InvalidCredentialException, OperationNotPermittedException, OperationFailedException
user - The name of the user (username).credential - The new credential (password). May not be null or blank.InvalidCredentialException - The supplied credential is invalid, this may be due the credential not matching required directory constraints.UserNotFoundException - if the supplied user does not exist in the directory.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void setUserAttribute(User user, String attributeName, String attributeValue) throws UserNotFoundException, OperationNotPermittedException, OperationFailedException
user - user to update.attributeName - the name of the attributeattributeValue - the new value of the attribute; any existing values will be replacedUserNotFoundException - the supplied user does not exist.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void setUserAttribute(User user, String attributeName, Set<String> attributeValues) throws UserNotFoundException, OperationNotPermittedException, OperationFailedException
user - user to update.attributeName - the name of the attributeattributeValues - the new set of values; any existing values will be replacedUserNotFoundException - the supplied user does not exist.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void removeUserAttribute(User user, String attributeName) throws UserNotFoundException, OperationNotPermittedException, OperationFailedException
user - user to update.attributeName - name of attribute to remove.UserNotFoundException - user with supplied username does not exist.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void removeAllUserAttributes(User user) throws UserNotFoundException, OperationNotPermittedException, OperationFailedException
user - user to update.UserNotFoundException - user with supplied username does not exist.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.boolean removeUser(User user) throws OperationNotPermittedException, OperationFailedException
user that matches the supplied name.user - user to remove.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.Group addGroup(Group group) throws InvalidGroupException, OperationNotPermittedException, OperationFailedException
group to the directory store.group - template of the group to add.InvalidGroupException - if the group already exists in ANY associated directory or the group template does not have the required properties populated.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.Group updateGroup(Group group) throws GroupNotFoundException, InvalidGroupException, OperationNotPermittedException, OperationFailedException
group.group - The group to update.GroupNotFoundException - if group with given name does not exist in ANY assigned directory.InvalidGroupException - the supplied group is invalid.OperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void setGroupAttribute(Group group, String attributeName, String attributeValue) throws GroupNotFoundException, OperationNotPermittedException, OperationFailedException
group - name of group to update.attributeName - the name up the attribute to add or updateattributeValue - the value of the attributeGroupNotFoundException - if the group could not be foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void setGroupAttribute(Group group, String attributeName, Set<String> attributeValues) throws GroupNotFoundException, OperationNotPermittedException, OperationFailedException
attributes. The attributes represents new or
updated attributes and does not replace existing attributes unless the key of an attribute matches the key of an
existing. This will not remove any attributes.group - name of group to update.attributeName - the name up the attribute to add or updateattributeValues - a set of values to updateGroupNotFoundException - if the group could not be foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void removeGroupAttribute(Group group, String attributeName) throws GroupNotFoundException, OperationNotPermittedException, OperationFailedException
group - to update.attributeName - name of attribute to remove.GroupNotFoundException - if the group could not be foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.void removeAllGroupAttributes(Group group) throws GroupNotFoundException, OperationNotPermittedException, OperationFailedException
group - to update.GroupNotFoundException - if the group could not be foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.boolean removeGroup(Group group) throws OperationNotPermittedException, OperationFailedException
group that matches the supplied name.group - to removeOperationNotPermittedException - if the directory does not allow removal of this groupOperationFailedException - underlying directory implementation failed to execute the operation.boolean addUserToGroup(User user, Group group) throws GroupNotFoundException, UserNotFoundException, OperationNotPermittedException, OperationFailedException
childGroup will
appear as members of parentGroup to querying applications.user - The user that will become a member of the groupgroup - The group that will gain a new member.UserNotFoundException - if the user could not be foundGroupNotFoundException - if the group could not be foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - underlying directory implementation failed to execute the operation.boolean addGroupToGroup(Group childGroup, Group parentGroup) throws GroupNotFoundException, OperationNotPermittedException, InvalidMembershipException, OperationFailedException
childGroup - The group that will become a member of parentGroupparentGroup - The group that will gain a new memberGroupNotFoundException - if any of the group could not be found. Use GroupNotFoundException.getGroupName()
to find out which group wasn't foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedInvalidMembershipException - If the relationship would cause a circular reference.OperationFailedException - underlying directory implementation failed to execute the operation.boolean removeUserFromGroup(User user, Group group) throws GroupNotFoundException, UserNotFoundException, OperationNotPermittedException, OperationFailedException
group - The group that will lose the member.user - The user that will be removed from the groupUserNotFoundException - if the user could not be foundGroupNotFoundException - if the group could not be foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - if the operation failed for any other reasonboolean removeGroupFromGroup(Group childGroup, Group parentGroup) throws GroupNotFoundException, OperationNotPermittedException, OperationFailedException
childGroup - The group that will be removed from parentGroupparentGroup - The group that will lose the member.GroupNotFoundException - if any of the groups could not be found. Use GroupNotFoundException.getGroupName()
to find out which group wasn't foundOperationNotPermittedException - if the directory has been configured to not allow the operation to be performedOperationFailedException - if the operation failed for any other reasonboolean isUserDirectGroupMember(User user, Group group) throws OperationFailedException
user - the user for whom to check the group membershipgroup - the group the user is believed to belong totrue if the user is a direct member of the group, false otherwise
(including if the user and/or group could not be found)OperationFailedException - underlying directory implementation failed to execute the operation.boolean isGroupDirectGroupMember(Group childGroup, Group parentGroup) throws OperationFailedException
childGroup - the group for which to check the parentGroup membershipparentGroup - the group the childGroup is believed to belong totrue if the childGroup is a direct member of the parentGroup, false otherwise
(including if neither group could be found)OperationFailedException - underlying directory implementation failed to execute the operation.@Deprecated Iterable<User> searchUsersAllowingDuplicateNames(Query<User> query)
User entities that match the supplied search query.
Users with duplicate user names can be returned.UserCapabilities getCapabilitiesForNewUsers()
new users.
Those capabilities reflects a specific moment in time and are subject to change if any user directory is added, removed or re-ordered.
addUser(User, String)Copyright © 2016 Atlassian. All Rights Reserved.