Class RestCrowdClient
- All Implemented Interfaces:
CrowdClient
-
Constructor Summary
ConstructorsConstructorDescriptionRestCrowdClient(RestExecutor executor) Please do not call this constructor directly.RestCrowdClient(ClientProperties clientProperties) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a group to the remote Crowd server.voidaddGroupToGroup(String childGroup, String parentGroup) Adds a group to a group.addUser(User user, PasswordCredential passwordCredential) Adds a new User to the remote Crowd server.addUser(UserWithAttributes user, PasswordCredential passwordCredential) Adds a new User to the remote Crowd server and will attempt to add the attributes atomically, but for Crowd servers < v2.9.0 atomic attribute adding may not be supported.voidaddUserToGroup(String username, String groupName) Adds a user to a group.authenticateSSOUser(UserAuthenticationContext userAuthenticationContext) Authenticates a Single-Sign-On (SSO) User.authenticateSSOUser(UserAuthenticationContext userAuthenticationContext, long duration) Authenticates a Single-Sign-On (SSO) User.authenticateSSOUserWithoutValidatingPassword(UserAuthenticationContext userAuthenticationContext) Authenticates a Single-Sign-On (SSO) User without validating password.authenticateUser(String username, String password) Authenticates a user with the server.voidExpires all passwords for all users in all directories for this application, regardless of group membership.findUserFromSSOToken(String token) Returns the user from the specified user token.getChildGroupsOfGroup(String groupName, int startIndex, int maxResults) Searches for groups who are direct members of a group.Returns the cookie configuration.Returns a token that can be used for querying events that have happened after the token was generated.Get a group by name.getGroupsForNestedUser(String userName, int startIndex, int maxResults) Searches for groups that a user is a nested member of.getGroupsForUser(String userName, int startIndex, int maxResults) Searches for groups that a user is a direct member of.getGroupsWithAttributesForUser(String userName, int startIndex, int maxResults) Searches for groups that a user is a member of, and returns those groups with all their attributes.getGroupWithAttributes(String name) Gets a group with attributes by name.Gets the full group membership details for all groups with all direct user members and child groups.getNamesOfChildGroupsOfGroup(String groupName, int startIndex, int maxResults) Searches for groups who are direct members of a group, returning the group names.getNamesOfGroupsForNestedUser(String userName, int startIndex, int maxResults) Searches for groups that a user is a nested member of, returning the group names.getNamesOfGroupsForUser(String userName, int startIndex, int maxResults) Searches for groups that a user is a direct member of, returning the group names.getNamesOfNestedChildGroupsOfGroup(String groupName, int startIndex, int maxResults) Searches for groups who are nested members of a group, returning the group names.getNamesOfNestedUsersOfGroup(String groupName, int startIndex, int maxResults) Searches for users who are nested members of a group, returning the user names.getNamesOfParentGroupsForGroup(String groupName, int startIndex, int maxResults) Searches for groups that a group is a direct member of, returning the group names.getNamesOfParentGroupsForNestedGroup(String groupName, int startIndex, int maxResults) Searches for groups that a group is a nested member of, returning the group names.getNamesOfUsersOfGroup(String groupName, int startIndex, int maxResults) Searches for users who are direct members of a group, returning the user names.getNestedChildGroupsOfGroup(String groupName, int startIndex, int maxResults) Searches for groups who are nested members of a group.getNestedUsersOfGroup(String groupName, int startIndex, int maxResults) Searches for users who are nested members of a group.getNewEvents(String eventToken) Returns an events object which contains a new eventToken and events that happened after the giveneventTokenwas generated.getParentGroupsForGroup(String groupName, int startIndex, int maxResults) Searches for groups that a group is a direct member of.getParentGroupsForNestedGroup(String groupName, int startIndex, int maxResults) Searches for groups that a group is a nested member of.Gets a User by user name.getUserByKey(String key) Gets a User by key.getUsersOfGroup(String groupName, int startIndex, int maxResults) Searches for users who are direct members of a group.getUserWithAttributes(String name) Gets a User with Attributes by user name.getWebhook(long webhookId) Retrieves a Webhook endpoint URL.voidinvalidateSSOToken(String token) Invalidates a token.voidinvalidateSSOTokensForUser(String username) Invalidates all tokens for a given user namevoidinvalidateSSOTokensForUser(String username, String exclude) Invalidates all tokens for a given user name, except for the given token.booleanisGroupDirectGroupMember(String childName, String parentName) Tests if a group is a direct member of a group.booleanisUserDirectGroupMember(String username, String groupName) Tests if a user is a direct member of a group.booleanisUserNestedGroupMember(String username, String groupName) Tests if a user is a nested member of a group.longregisterWebhook(String endpointUrl, String token) Registers a new Webhook on the server.voidremoveGroup(String groupName) Removes a group from the remote Crowd servervoidremoveGroupAttributes(String groupName, String attributeName) Removes a group attribute (set) from the server.voidremoveGroupFromGroup(String childGroup, String parentGroup) Removes a group to a group.voidremoveUser(String username) Removes a user from the remote Crowd servervoidremoveUserAttributes(String username, String attributeName) Removes a user attribute from the server.voidremoveUserFromGroup(String username, String groupName) Removes a user from a group.renameUser(String oldUsername, String newUsername) Renames a user on the remote Crowd server, initially finding them by their current username.voidrequestPasswordReset(String username) Requests a password reset.voidrequestUsernames(String email) Sends the usernames associated with the given email address.searchGroupNames(SearchRestriction searchRestriction, int startIndex, int maxResults) Searches for group names matching thesearchRestrictioncriteria.searchGroups(SearchRestriction searchRestriction, int startIndex, int maxResults) Searches for groups matching the following criteria.searchGroupsWithAttributes(SearchRestriction searchRestriction, int startIndex, int maxResults) Searches for groups (with their attributes) matching the following criteria.searchUserNames(SearchRestriction searchRestriction, int startIndex, int maxResults) Searches for usernames matching thesearchRestrictioncriteria.searchUsers(SearchRestriction searchRestriction, int startIndex, int maxResults) Searches for users matching the following criteria.searchUsersWithAttributes(SearchRestriction searchRestriction, int startIndex, int maxResults) Searches for users (with their attributes) matching the following criteria.voidshutdown()Closes this Crowd Client and releases any system resources associated with the client.voidStores the group's attributes on the remote Crowd server.voidStores the user's attributes on the remote Crowd server.voidTests if the connection is OK.voidunregisterWebhook(long webhookId) Unregisters a Webhook on the server.voidupdateGroup(Group group) Updates a group on the remote Crowd server.voidupdateUser(User user) Updates a user on the remote Crowd server.voidupdateUserCredential(String username, String password) Updates the user's password on the remote Crowd server.userAuthenticated(String username) voidvalidateSSOAuthentication(String token, List<ValidationFactor> validationFactors) Validates the SSO authentication.validateSSOAuthenticationAndGetSession(String token, List<ValidationFactor> validationFactors) Validates the SSO authentication.
-
Constructor Details
-
RestCrowdClient
Deprecated.use theRestCrowdClientFactorymethodsConstructs a new REST Crowd Client instance. This client provides a simple interface for interacting with a remote Crowd server. The client is thread safe.- Parameters:
clientProperties- crowd properties for the client
-
RestCrowdClient
Please do not call this constructor directly. Use the methods inRestCrowdClientFactoryinstead.
-
-
Method Details
-
getUser
public User getUser(String name) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientGets a User by user name.- Specified by:
getUserin interfaceCrowdClient- Parameters:
name- Name of the user to retrieve- Returns:
- A User.
- Throws:
UserNotFoundException- if the user is not foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getUserWithAttributes
public UserWithAttributes getUserWithAttributes(String name) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientGets a User with Attributes by user name.- Specified by:
getUserWithAttributesin interfaceCrowdClient- Parameters:
name- Name of the user to retrieve- Returns:
- A User.
- Throws:
UserNotFoundException- if the user is not foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getUserByKey
public User getUserByKey(String key) throws UserNotFoundException, OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException Description copied from interface:CrowdClientGets a User by key.- Specified by:
getUserByKeyin interfaceCrowdClient- Parameters:
key- Name of the user to retrieve- Returns:
- A User.
- Throws:
UserNotFoundException- if the user is not foundOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not valid
-
authenticateUser
public User authenticateUser(String username, String password) throws UserNotFoundException, InactiveAccountException, ExpiredCredentialException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientAuthenticates a user with the server.- Specified by:
authenticateUserin interfaceCrowdClient- Parameters:
username- Name of the user to authenticate.password- Password of the user to authenticate.- Returns:
- user if the user is correctly authenticated
- Throws:
UserNotFoundException- if the user could not be foundInactiveAccountException- if the user account is not activeExpiredCredentialException- if the user credentials have expiredApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
userAuthenticated
public User userAuthenticated(String username) throws ApplicationPermissionException, OperationFailedException, InvalidAuthenticationException, UserNotFoundException, InactiveAccountException - Specified by:
userAuthenticatedin interfaceCrowdClient- Throws:
ApplicationPermissionExceptionOperationFailedExceptionInvalidAuthenticationExceptionUserNotFoundExceptionInactiveAccountException
-
addUser
public UserWithAttributes addUser(UserWithAttributes user, PasswordCredential passwordCredential) throws ApplicationPermissionException, InvalidUserException, InvalidCredentialException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientAdds a new User to the remote Crowd server and will attempt to add the attributes atomically, but for Crowd servers < v2.9.0 atomic attribute adding may not be supported. If adding attributes is not supported, NULL will be returned and it is the clients responsibility to callCrowdClient.storeUserAttributes(String, Map)afterwards.- Specified by:
addUserin interfaceCrowdClient- Parameters:
user- The user to addpasswordCredential- user password- Returns:
- User the user created by the server, or null if the server does not support returning users.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidUserException- if the user is invalid. This may be because a user of the same name already exists, or does not pass the server side validation rules.InvalidCredentialException- if the password is invalid. It must conform to the rules set on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
addUser
public UserWithAttributes addUser(User user, PasswordCredential passwordCredential) throws ApplicationPermissionException, InvalidUserException, InvalidCredentialException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientAdds a new User to the remote Crowd server. This may return NULL if the remote server is older than v2.8. This will not store the users attributes.- Specified by:
addUserin interfaceCrowdClient- Parameters:
user- The user to addpasswordCredential- user password- Returns:
- User the user created by the server, or null if the server does not support returning users.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidUserException- if the user is invalid. This may be because a user of the same name already exists, or does not pass the server side validation rules.InvalidCredentialException- if the password is invalid. It must conform to the rules set on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
updateUser
public void updateUser(User user) throws InvalidUserException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientUpdates a user on the remote Crowd server.- Specified by:
updateUserin interfaceCrowdClient- Parameters:
user- The user to update- Throws:
InvalidUserException- the details of the user to be updated are invalid. This may be because the user details do not pass the server side validation rules.UserNotFoundException- if the user does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
renameUser
public User renameUser(String oldUsername, String newUsername) throws InvalidUserException, UserNotFoundException, OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException Description copied from interface:CrowdClientRenames a user on the remote Crowd server, initially finding them by their current username.- Specified by:
renameUserin interfaceCrowdClient- Parameters:
oldUsername- current name of the user to renamenewUsername- the intended new name of the user; must not be the same asoldUsername- Returns:
- the user with the new name
- Throws:
InvalidUserException- the details of the user to be updated are invalid. This may be because the user details do not pass the server side validation rules.UserNotFoundException- if the user does not exist on the remote Crowd serverOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not valid
-
updateUserCredential
public void updateUserCredential(String username, String password) throws InvalidCredentialException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientUpdates the user's password on the remote Crowd server.- Specified by:
updateUserCredentialin interfaceCrowdClient- Parameters:
username- Name of the user to update.password- New password. A null value indicates that the user's password should be cleared.- Throws:
InvalidCredentialException- if the password is invalid. It must conform to the rules set on the serverUserNotFoundException- if the user does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
requestPasswordReset
public void requestPasswordReset(String username) throws UserNotFoundException, InvalidEmailAddressException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRequests a password reset.- Specified by:
requestPasswordResetin interfaceCrowdClient- Parameters:
username- name of the user- Throws:
UserNotFoundException- if the user does not existInvalidEmailAddressException- if the user does not have a valid email to send the reset password link toApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
requestUsernames
public void requestUsernames(String email) throws InvalidEmailAddressException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSends the usernames associated with the given email address. No email will be sent if there are no usernames associated with a givenemail.- Specified by:
requestUsernamesin interfaceCrowdClient- Parameters:
email- email address of the user- Throws:
InvalidEmailAddressException- if theemailis not validApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
storeUserAttributes
public void storeUserAttributes(String username, Map<String, Set<String>> attributes) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedExceptionDescription copied from interface:CrowdClientStores the user's attributes on the remote Crowd server.- Specified by:
storeUserAttributesin interfaceCrowdClient- Parameters:
username- Name of the user.attributes- Set of Attributes to store. Attributes will be added or if an attribute with the same key exists will be replaced.- Throws:
UserNotFoundException- if the user does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
removeUserAttributes
public void removeUserAttributes(String username, String attributeName) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRemoves a user attribute from the server. If the attribute to be removed does not exist, no error is reported.- Specified by:
removeUserAttributesin interfaceCrowdClient- Parameters:
username- Name of the userattributeName- Attribute key.- Throws:
UserNotFoundException- if the user does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
removeUser
public void removeUser(String username) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRemoves a user from the remote Crowd server- Specified by:
removeUserin interfaceCrowdClient- Parameters:
username- Name of the user to remove.- Throws:
UserNotFoundException- if the user does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getGroup
public Group getGroup(String name) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Get a group by name.- Specified by:
getGroupin interfaceCrowdClient- Parameters:
name- name of the group to retrieve.- Returns:
- A Group
- Throws:
GroupNotFoundException- The group does not exist on the remote server.OperationFailedException- For any other communication errors.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not valid
-
getGroupWithAttributes
public GroupWithAttributes getGroupWithAttributes(String name) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientGets a group with attributes by name.- Specified by:
getGroupWithAttributesin interfaceCrowdClient- Parameters:
name- name of the group to retrieve.- Returns:
- A Group with attributes.
- Throws:
GroupNotFoundException- if the group does not exist on the remote serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
addGroup
public void addGroup(Group group) throws InvalidGroupException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientAdds a group to the remote Crowd server.- Specified by:
addGroupin interfaceCrowdClient- Parameters:
group- Group to add.- Throws:
InvalidGroupException- if the group is invalid. This may be because a group of the same name already exists, or does not pass the server side validation rulesApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
updateGroup
public void updateGroup(Group group) throws InvalidGroupException, GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientUpdates a group on the remote Crowd server.- Specified by:
updateGroupin interfaceCrowdClient- Parameters:
group- Group to update.- Throws:
InvalidGroupException- The group is invalid. This may be because the group does not pass the server side validation rules.GroupNotFoundException- if the group does not exist on the remote serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
storeGroupAttributes
public void storeGroupAttributes(String groupName, Map<String, Set<String>> attributes) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedExceptionDescription copied from interface:CrowdClientStores the group's attributes on the remote Crowd server.- Specified by:
storeGroupAttributesin interfaceCrowdClient- Parameters:
groupName- Name of the group.attributes- Set of Attributes to store. Attributes will be added or if an attribute with the same key exists will be replaced.- Throws:
GroupNotFoundException- if the group does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
removeGroupAttributes
public void removeGroupAttributes(String groupName, String attributeName) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRemoves a group attribute (set) from the server. If the attribute to be removed does not exist, no error is reported.- Specified by:
removeGroupAttributesin interfaceCrowdClient- Parameters:
groupName- Name of the groupattributeName- Attribute key.- Throws:
GroupNotFoundException- the group does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
removeGroup
public void removeGroup(String groupName) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRemoves a group from the remote Crowd server- Specified by:
removeGroupin interfaceCrowdClient- Parameters:
groupName- Name of the group to remove.- Throws:
GroupNotFoundException- the group does not exist on the remote Crowd serverApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
isUserDirectGroupMember
public boolean isUserDirectGroupMember(String username, String groupName) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientTests if a user is a direct member of a group.- Specified by:
isUserDirectGroupMemberin interfaceCrowdClient- Parameters:
username- User namegroupName- Group Name- Returns:
- true if the member is a direct member of the group.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
isUserNestedGroupMember
public boolean isUserNestedGroupMember(String username, String groupName) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientTests if a user is a nested member of a group.- Specified by:
isUserNestedGroupMemberin interfaceCrowdClient- Parameters:
username- User namegroupName- Group Name- Returns:
- true if the member is a nested member of the group.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
isGroupDirectGroupMember
public boolean isGroupDirectGroupMember(String childName, String parentName) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientTests if a group is a direct member of a group.- Specified by:
isGroupDirectGroupMemberin interfaceCrowdClient- Parameters:
childName- Name of the child groupparentName- Name of the Parent group- Returns:
- true if the child group is a direct member of the parent group.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
addUserToGroup
public void addUserToGroup(String username, String groupName) throws GroupNotFoundException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, MembershipAlreadyExistsException Description copied from interface:CrowdClientAdds a user to a group.- Specified by:
addUserToGroupin interfaceCrowdClient- Parameters:
username- Name of the user to add to the group.groupName- Name of the group to be added to.- Throws:
GroupNotFoundException- if the group does not exist.UserNotFoundException- if the user does not exist.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.MembershipAlreadyExistsException- if the user is already a member fo the group
-
addGroupToGroup
public void addGroupToGroup(String childGroup, String parentGroup) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, MembershipAlreadyExistsException Description copied from interface:CrowdClientAdds a group to a group.- Specified by:
addGroupToGroupin interfaceCrowdClient- Parameters:
childGroup- Name of the group to add to the parent group.parentGroup- Name of the group the child will be added to.- Throws:
GroupNotFoundException- if either group does not existApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.MembershipAlreadyExistsException- if the child group is already a member of the parent group
-
removeUserFromGroup
public void removeUserFromGroup(String username, String groupName) throws MembershipNotFoundException, GroupNotFoundException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRemoves a user from a group.- Specified by:
removeUserFromGroupin interfaceCrowdClient- Parameters:
username- Name of the user to add to the group.groupName- Name of the group to be added to.- Throws:
MembershipNotFoundException- if the membership does not existGroupNotFoundException- if the group does not exist.UserNotFoundException- if the user does not exist.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
removeGroupFromGroup
public void removeGroupFromGroup(String childGroup, String parentGroup) throws MembershipNotFoundException, GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRemoves a group to a group.- Specified by:
removeGroupFromGroupin interfaceCrowdClient- Parameters:
childGroup- Name of the group to be removed from the parent group.parentGroup- Name of the group the child group will be removed from.- Throws:
MembershipNotFoundException- if there is not parent-child relationship between the specified groupsGroupNotFoundException- if either group does not exist.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if for some reason the operation has failed
-
testConnection
public void testConnection() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedExceptionDescription copied from interface:CrowdClientTests if the connection is OK. This test uses a user search to validate the connection. It will fail if the application does not have permission to perform this very basic operation.- Specified by:
testConnectionin interfaceCrowdClient- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the test fails
-
searchUsers
public List<User> searchUsers(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for users matching the following criteria.- Specified by:
searchUsersin interfaceCrowdClient- Parameters:
searchRestriction- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of users satisfying the search restriction.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
searchUsersWithAttributes
public List<UserWithAttributes> searchUsersWithAttributes(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for users (with their attributes) matching the following criteria.- Specified by:
searchUsersWithAttributesin interfaceCrowdClient- Parameters:
searchRestriction- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of users (with their attributes) satisfying the search restriction.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
searchUserNames
public List<String> searchUserNames(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for usernames matching thesearchRestrictioncriteria.- Specified by:
searchUserNamesin interfaceCrowdClient- Parameters:
searchRestriction- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of usernames satisfying the search restriction.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
searchGroups
public List<Group> searchGroups(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups matching the following criteria.- Specified by:
searchGroupsin interfaceCrowdClient- Parameters:
searchRestriction- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restriction.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
searchGroupsWithAttributes
public List<GroupWithAttributes> searchGroupsWithAttributes(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups (with their attributes) matching the following criteria.- Specified by:
searchGroupsWithAttributesin interfaceCrowdClient- Parameters:
searchRestriction- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups (with their attributes) satisfying the search restriction.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
searchGroupNames
public List<String> searchGroupNames(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for group names matching thesearchRestrictioncriteria.- Specified by:
searchGroupNamesin interfaceCrowdClient- Parameters:
searchRestriction- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of group names satisfying the search restriction.
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getUsersOfGroup
public List<User> getUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for users who are direct members of a group.- Specified by:
getUsersOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of users satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfUsersOfGroup
public List<String> getNamesOfUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for users who are direct members of a group, returning the user names.- Specified by:
getNamesOfUsersOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of user names satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getChildGroupsOfGroup
public List<Group> getChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups who are direct members of a group.- Specified by:
getChildGroupsOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restrictions
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfChildGroupsOfGroup
public List<String> getNamesOfChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups who are direct members of a group, returning the group names.- Specified by:
getNamesOfChildGroupsOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of group names satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getGroupsForUser
public List<Group> getGroupsForUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a user is a direct member of.- Specified by:
getGroupsForUserin interfaceCrowdClient- Parameters:
userName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restriction.
- Throws:
UserNotFoundException- if the user could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getGroupsWithAttributesForUser
public List<GroupWithAttributes> getGroupsWithAttributesForUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a user is a member of, and returns those groups with all their attributes. This will only work for Crowd servers >= 2.9, otherwise attributes will not be returned and behaviour will be the same asCrowdClient.getGroupsForUser(java.lang.String, int, int).- Specified by:
getGroupsWithAttributesForUserin interfaceCrowdClient- Parameters:
userName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restriction.
- Throws:
UserNotFoundException- if the user could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfGroupsForUser
public List<String> getNamesOfGroupsForUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a user is a direct member of, returning the group names.- Specified by:
getNamesOfGroupsForUserin interfaceCrowdClient- Parameters:
userName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of group names satisfying the search restriction.
- Throws:
UserNotFoundException- if the user could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getParentGroupsForGroup
public List<Group> getParentGroupsForGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a group is a direct member of.- Specified by:
getParentGroupsForGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfParentGroupsForGroup
public List<String> getNamesOfParentGroupsForGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a group is a direct member of, returning the group names.- Specified by:
getNamesOfParentGroupsForGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of group names satisfying the search restriction
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNestedUsersOfGroup
public List<User> getNestedUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for users who are nested members of a group.- Specified by:
getNestedUsersOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of users satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfNestedUsersOfGroup
public List<String> getNamesOfNestedUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for users who are nested members of a group, returning the user names.- Specified by:
getNamesOfNestedUsersOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of user names satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNestedChildGroupsOfGroup
public List<Group> getNestedChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups who are nested members of a group.- Specified by:
getNestedChildGroupsOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfNestedChildGroupsOfGroup
public List<String> getNamesOfNestedChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups who are nested members of a group, returning the group names.- Specified by:
getNamesOfNestedChildGroupsOfGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of group names satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getGroupsForNestedUser
public List<Group> getGroupsForNestedUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a user is a nested member of.- Specified by:
getGroupsForNestedUserin interfaceCrowdClient- Parameters:
userName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restriction.
- Throws:
UserNotFoundException- if the user could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfGroupsForNestedUser
public List<String> getNamesOfGroupsForNestedUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a user is a nested member of, returning the group names.- Specified by:
getNamesOfGroupsForNestedUserin interfaceCrowdClient- Parameters:
userName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of group names satisfying the search restriction.
- Throws:
UserNotFoundException- if the user could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getParentGroupsForNestedGroup
public List<Group> getParentGroupsForNestedGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a group is a nested member of.- Specified by:
getParentGroupsForNestedGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of groups satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getNamesOfParentGroupsForNestedGroup
public List<String> getNamesOfParentGroupsForNestedGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientSearches for groups that a group is a nested member of, returning the group names.- Specified by:
getNamesOfParentGroupsForNestedGroupin interfaceCrowdClient- Parameters:
groupName- restriction on the searchstartIndex- starting index of the search resultsmaxResults- maximum number of results returned from the search- Returns:
- List of group names satisfying the search restriction.
- Throws:
GroupNotFoundException- if the group could not be foundApplicationPermissionException- if the application is not permitted to perform the requested operation on the server.InvalidAuthenticationException- if the application and password are not valid.OperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
getMemberships
public Iterable<Membership> getMemberships() throws OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException, UnsupportedCrowdApiExceptionDescription copied from interface:CrowdClientGets the full group membership details for all groups with all direct user members and child groups. The result may be large and this operation may be slow.
This method is only supported when the server supports version 1.1 of the user management API. Clients should be ready to catch
UnsupportedCrowdApiExceptionand fall back to another technique if they need to remain backwards compatible.- Specified by:
getMembershipsin interfaceCrowdClient- Returns:
- an
Iterableof the memberships for all groups - Throws:
OperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validUnsupportedCrowdApiException- if the server does not support version 1.1 of the user management API
-
findUserFromSSOToken
public User findUserFromSSOToken(String token) throws InvalidTokenException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientReturns the user from the specified user token.- Specified by:
findUserFromSSOTokenin interfaceCrowdClient- Parameters:
token- user token used to find the authenticated user.- Returns:
- User associated with the token.
- Throws:
InvalidTokenException- if the provided token is not validApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
authenticateSSOUser
public String authenticateSSOUser(UserAuthenticationContext userAuthenticationContext) throws ApplicationAccessDeniedException, ExpiredCredentialException, InactiveAccountException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientAuthenticates a Single-Sign-On (SSO) User.- Specified by:
authenticateSSOUserin interfaceCrowdClient- Parameters:
userAuthenticationContext- the user's authentication details.- Returns:
- SSO token if successful.
- Throws:
ApplicationAccessDeniedException- if the user does not have access to authenticate against the applicationExpiredCredentialException- if the user password has expired and the user is required to change their passwordInactiveAccountException- if the user account is inactiveApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
authenticateSSOUser
public String authenticateSSOUser(UserAuthenticationContext userAuthenticationContext, long duration) throws ApplicationAccessDeniedException, ExpiredCredentialException, InactiveAccountException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientAuthenticates a Single-Sign-On (SSO) User.- Specified by:
authenticateSSOUserin interfaceCrowdClient- Parameters:
userAuthenticationContext- the user's authentication details.duration- requested duration of the new token (in seconds)- Returns:
- SSO token if successful.
- Throws:
ApplicationAccessDeniedException- if the user does not have access to authenticate against the applicationExpiredCredentialException- if the user password has expired and the user is required to change their passwordInactiveAccountException- if the user account is inactiveApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
authenticateSSOUserWithoutValidatingPassword
public String authenticateSSOUserWithoutValidatingPassword(UserAuthenticationContext userAuthenticationContext) throws ApplicationAccessDeniedException, InactiveAccountException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientAuthenticates a Single-Sign-On (SSO) User without validating password.- Specified by:
authenticateSSOUserWithoutValidatingPasswordin interfaceCrowdClient- Parameters:
userAuthenticationContext- the user's authentication details.- Returns:
- SSO token if successful.
- Throws:
ApplicationAccessDeniedException- if the user does not have access to authenticate against the applicationInactiveAccountException- if the user account has expiredApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
validateSSOAuthentication
public void validateSSOAuthentication(String token, List<ValidationFactor> validationFactors) throws InvalidTokenException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientValidates the SSO authentication. Throws InvalidAuthenticationException if the SSO authentication is not valid.- Specified by:
validateSSOAuthenticationin interfaceCrowdClient- Parameters:
token- Crowd SSO tokenvalidationFactors- Details of where the user's come from. If presented, must match those presented during authentication.- Throws:
InvalidTokenException- if the supplied token is not validApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
validateSSOAuthenticationAndGetSession
public Session validateSSOAuthenticationAndGetSession(String token, List<ValidationFactor> validationFactors) throws InvalidTokenException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientValidates the SSO authentication. Throws InvalidAuthenticationException if the SSO authentication is not valid.- Specified by:
validateSSOAuthenticationAndGetSessionin interfaceCrowdClient- Parameters:
token- Crowd SSO tokenvalidationFactors- Details of where the user's come from. If presented, must match those presented during authentication.- Returns:
- the current session
- Throws:
InvalidTokenException- if the supplied token is not validApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
invalidateSSOToken
public void invalidateSSOToken(String token) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientInvalidates a token. If the token does not exist, the token should still return silently.- Specified by:
invalidateSSOTokenin interfaceCrowdClient- Parameters:
token- a non-empty token to invalidate- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validOperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
invalidateSSOTokensForUser
public void invalidateSSOTokensForUser(String username) throws OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException, UnsupportedCrowdApiException Description copied from interface:CrowdClientInvalidates all tokens for a given user name- Specified by:
invalidateSSOTokensForUserin interfaceCrowdClient- Parameters:
username- User whose sessions will be invalidated- Throws:
OperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validUnsupportedCrowdApiException- if the remote server does not support this operation
-
invalidateSSOTokensForUser
public void invalidateSSOTokensForUser(String username, String exclude) throws OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException, UnsupportedCrowdApiException Description copied from interface:CrowdClientInvalidates all tokens for a given user name, except for the given token.- Specified by:
invalidateSSOTokensForUserin interfaceCrowdClient- Parameters:
username- User whose sessions will be invalidatedexclude- Token to be saved- Throws:
OperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the serverInvalidAuthenticationException- if the application and password are not validUnsupportedCrowdApiException- if the remote server does not support this operation
-
getCookieConfiguration
public CookieConfiguration getCookieConfiguration() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedExceptionDescription copied from interface:CrowdClientReturns the cookie configuration.- Specified by:
getCookieConfigurationin interfaceCrowdClient- Returns:
- cookie configuration
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the server.InvalidAuthenticationException- if the application and password are not valid.OperationFailedException- if the operation has failed for any other reason, including invalid arguments and the operation not being supported on the server.
-
shutdown
public void shutdown()Description copied from interface:CrowdClientCloses this Crowd Client and releases any system resources associated with the client.The client can no longer be used once shutdown.
Calling this method more than once will have no effect.
- Specified by:
shutdownin interfaceCrowdClient
-
getCurrentEventToken
public String getCurrentEventToken() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, IncrementalSynchronisationNotAvailableExceptionDescription copied from interface:CrowdClientReturns a token that can be used for querying events that have happened after the token was generated.If the event token has not changed since the last call to this method, it is guaranteed that no new events have been received.
The format of event token is implementation specific and can change without a warning.
- Specified by:
getCurrentEventTokenin interfaceCrowdClient- Returns:
- token that can be used for querying events that have happened after the token was generated
- Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the server.InvalidAuthenticationException- if the application and password are not valid.OperationFailedException- if the operation has failed for any other reason, including invalid argumentsIncrementalSynchronisationNotAvailableException- if the application cannot provide incremental synchronisation
-
getNewEvents
public Events getNewEvents(String eventToken) throws EventTokenExpiredException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientReturns an events object which contains a new eventToken and events that happened after the giveneventTokenwas generated.If for any reason event store is unable to retrieve events that happened after the event token was generated, an
EventTokenExpiredExceptionwill be thrown. The caller is then expected to callCrowdClient.getCurrentEventToken()again before asking for new events.- Specified by:
getNewEventsin interfaceCrowdClient- Parameters:
eventToken- event token that was retrieved by a call toCrowdClient.getCurrentEventToken()or this method- Returns:
- events object which contains a new eventToken and events that happened after the given
eventTokenwas generated - Throws:
EventTokenExpiredException- if events that happened after the event token was generated can not be retrievedApplicationPermissionException- if the application is not permitted to perform the requested operation on the server.InvalidAuthenticationException- if the application and password are not valid.OperationFailedException- if the operation has failed for any other reason, including invalid arguments
-
getWebhook
public String getWebhook(long webhookId) throws InvalidAuthenticationException, ApplicationPermissionException, OperationFailedException, WebhookNotFoundException Description copied from interface:CrowdClientRetrieves a Webhook endpoint URL.- Specified by:
getWebhookin interfaceCrowdClient- Parameters:
webhookId- a Webhook identifier, as returned byCrowdClient.registerWebhook(String, String)- Returns:
- the endpoint URL associated to the Webhook
- Throws:
InvalidAuthenticationException- if the application and password are not valid.ApplicationPermissionException- if the application is not permitted to perform the requested operation on the server.OperationFailedException- if the operation has failed for any other reason.WebhookNotFoundException- if the Webhook is not registered
-
registerWebhook
public long registerWebhook(String endpointUrl, @Nullable String token) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException Description copied from interface:CrowdClientRegisters a new Webhook on the server. The Webhook will be called back when the Crowd server produces new events. Applications are expected to request a new event tokenCrowdClient.getCurrentEventToken()after registering a Webhook, so then can obtain the new events usingCrowdClient.getNewEvents(String)in the Webhook callback.This operation is idempotent, i.e., an attempt to register a callback with the same endpointUrl as an existing Webhook already registered by the same application will return the identifier of the existing Webhook.
If an application dies, or otherwise terminates without unregistering its Webhooks, Crowd reserves its rights to eventually unregister any Webhook that is no longer responding to the pings with an HTTP 2xx status code. Crowd may implement a fault-tolerant policy for Webhooks that are temporarily unreachable, but it is the application's responsibility to maintain the connection.
- Specified by:
registerWebhookin interfaceCrowdClient- Parameters:
endpointUrl- URL of the HTTP endpoint provided by the application. Crowd will ping the Webhook by issuing a body-less POST request when new events are available. The Webhook must respond with an HTTP 2xx status code.token- the token that Crowd will present when pinging the Webhook (optional).- Returns:
- an identifier of the Webhook, that can be used to unregister it
CrowdClient.unregisterWebhook(long). - Throws:
ApplicationPermissionException- if the application is not permitted to perform the requested operation on the server.InvalidAuthenticationException- if the application and password are not valid.OperationFailedException- if the operation has failed for any other reason.
-
unregisterWebhook
public void unregisterWebhook(long webhookId) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, WebhookNotFoundException Description copied from interface:CrowdClientUnregisters a Webhook on the server. Well-behaved applications are expected to unregister their Webhooks when they no longer need them to free resources on the server. Otherwise, Crowd may unilaterally unregister the non-responding Webhooks, as described inCrowdClient.registerWebhook(String, String).- Specified by:
unregisterWebhookin interfaceCrowdClient- Parameters:
webhookId- The identifier of the Webhook returned byCrowdClient.registerWebhook(String, String).- Throws:
ApplicationPermissionException- if the Webhook identifier does not match any of the Webhooks previously registered by the application.InvalidAuthenticationException- if the application and password are not valid.OperationFailedException- if the operation has failed for any other reason.WebhookNotFoundException- if the Webhook is not found, or it not owned by the application, or the remote API does not support this operation
-
expireAllPasswords
public void expireAllPasswords() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedExceptionDescription copied from interface:CrowdClientExpires all passwords for all users in all directories for this application, regardless of group membership.- Specified by:
expireAllPasswordsin interfaceCrowdClient- Throws:
ApplicationPermissionException- if the application credentials are not correct.InvalidAuthenticationException- if the authentication is not correct.OperationFailedException- if the operation fails for any of the directories. This would mean some passwords have expired while others have not.
-
RestCrowdClientFactorymethods