public class RestCrowdClient extends Object implements CrowdClient
Constructor and Description |
---|
RestCrowdClient(ClientProperties clientProperties)
Deprecated.
use the
RestCrowdClientFactory methods |
RestCrowdClient(RestExecutor executor)
Please do not call this constructor directly.
|
Modifier and Type | Method and Description |
---|---|
void |
addGroup(Group group)
Adds a group to the remote Crowd server.
|
void |
addGroupToGroup(String childGroup,
String parentGroup)
Adds a group to a group.
|
UserWithAttributes |
addUser(User user,
PasswordCredential passwordCredential)
Adds a new User to the remote Crowd server.
|
UserWithAttributes |
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.
|
void |
addUserToGroup(String username,
String groupName)
Adds a user to a group.
|
String |
authenticateSSOUser(UserAuthenticationContext userAuthenticationContext)
Authenticates a Single-Sign-On (SSO) User.
|
String |
authenticateSSOUser(UserAuthenticationContext userAuthenticationContext,
long duration)
Authenticates a Single-Sign-On (SSO) User.
|
String |
authenticateSSOUserWithoutValidatingPassword(UserAuthenticationContext userAuthenticationContext)
Authenticates a Single-Sign-On (SSO) User without validating password.
|
User |
authenticateUser(String username,
String password)
Authenticates a user with the server.
|
void |
expireAllPasswords()
Expires all passwords for all users in all directories for this application,
regardless of group membership.
|
User |
findUserFromSSOToken(String token)
Returns the user from the specified user token.
|
List<Group> |
getChildGroupsOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups who are direct members of a group.
|
CookieConfiguration |
getCookieConfiguration()
Returns the cookie configuration.
|
String |
getCurrentEventToken()
Returns a token that can be used for querying events that have happened
after the token was generated.
|
Group |
getGroup(String name)
Get a group by name.
|
List<Group> |
getGroupsForNestedUser(String userName,
int startIndex,
int maxResults)
Searches for groups that a user is a nested member of.
|
List<Group> |
getGroupsForUser(String userName,
int startIndex,
int maxResults)
Searches for groups that a user is a direct member of.
|
List<GroupWithAttributes> |
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.
|
GroupWithAttributes |
getGroupWithAttributes(String name)
Gets a group with attributes by name.
|
Iterable<Membership> |
getMemberships()
Gets the full group membership details for all groups with all direct user members and child groups.
|
List<String> |
getNamesOfChildGroupsOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups who are direct members of a group, returning the group names.
|
List<String> |
getNamesOfGroupsForNestedUser(String userName,
int startIndex,
int maxResults)
Searches for groups that a user is a nested member of, returning the group names.
|
List<String> |
getNamesOfGroupsForUser(String userName,
int startIndex,
int maxResults)
Searches for groups that a user is a direct member of, returning the group names.
|
List<String> |
getNamesOfNestedChildGroupsOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups who are nested members of a group, returning the group names.
|
List<String> |
getNamesOfNestedUsersOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for users who are nested members of a group, returning the user names.
|
List<String> |
getNamesOfParentGroupsForGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups that a group is a direct member of, returning the group names.
|
List<String> |
getNamesOfParentGroupsForNestedGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups that a group is a nested member of, returning the group names.
|
List<String> |
getNamesOfUsersOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for users who are direct members of a group, returning the user names.
|
List<Group> |
getNestedChildGroupsOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups who are nested members of a group.
|
List<User> |
getNestedUsersOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for users who are nested members of a group.
|
Events |
getNewEvents(String eventToken)
Returns an events object which contains a new eventToken and events that
happened after the given
eventToken was generated. |
List<Group> |
getParentGroupsForGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups that a group is a direct member of.
|
List<Group> |
getParentGroupsForNestedGroup(String groupName,
int startIndex,
int maxResults)
Searches for groups that a group is a nested member of.
|
User |
getUser(String name)
Gets a User by user name.
|
User |
getUserByKey(String key)
Gets a User by key.
|
List<User> |
getUsersOfGroup(String groupName,
int startIndex,
int maxResults)
Searches for users who are direct members of a group.
|
UserWithAttributes |
getUserWithAttributes(String name)
Gets a User with Attributes by user name.
|
String |
getWebhook(long webhookId)
Retrieves a Webhook endpoint URL.
|
void |
invalidateSSOToken(String token)
Invalidates a token.
|
void |
invalidateSSOTokensForUser(String username)
Invalidates all tokens for a given user name
|
void |
invalidateSSOTokensForUser(String username,
String exclude)
Invalidates all tokens for a given user name, except for the given token.
|
boolean |
isGroupDirectGroupMember(String childName,
String parentName)
Tests if a group is a direct member of a group.
|
boolean |
isUserDirectGroupMember(String username,
String groupName)
Tests if a user is a direct member of a group.
|
boolean |
isUserNestedGroupMember(String username,
String groupName)
Tests if a user is a nested member of a group.
|
long |
registerWebhook(String endpointUrl,
String token)
Registers a new Webhook on the server.
|
void |
removeGroup(String groupName)
Removes a group from the remote Crowd server
|
void |
removeGroupAttributes(String groupName,
String attributeName)
Removes a group attribute (set) from the server.
|
void |
removeGroupFromGroup(String childGroup,
String parentGroup)
Removes a group to a group.
|
void |
removeUser(String username)
Removes a user from the remote Crowd server
|
void |
removeUserAttributes(String username,
String attributeName)
Removes a user attribute from the server.
|
void |
removeUserFromGroup(String username,
String groupName)
Removes a user from a group.
|
User |
renameUser(String oldUsername,
String newUsername)
Renames a user on the remote Crowd server, initially finding them by their current username.
|
void |
requestPasswordReset(String username)
Requests a password reset.
|
void |
requestUsernames(String email)
Sends the usernames associated with the given email address.
|
List<String> |
searchGroupNames(SearchRestriction searchRestriction,
int startIndex,
int maxResults)
Searches for group names matching the searchRestriction criteria.
|
List<Group> |
searchGroups(SearchRestriction searchRestriction,
int startIndex,
int maxResults)
Searches for groups matching the following criteria.
|
List<GroupWithAttributes> |
searchGroupsWithAttributes(SearchRestriction searchRestriction,
int startIndex,
int maxResults)
Searches for groups (with their attributes) matching the following criteria.
|
List<String> |
searchUserNames(SearchRestriction searchRestriction,
int startIndex,
int maxResults)
Searches for usernames matching the searchRestriction criteria.
|
List<User> |
searchUsers(SearchRestriction searchRestriction,
int startIndex,
int maxResults)
Searches for users matching the following criteria.
|
List<UserWithAttributes> |
searchUsersWithAttributes(SearchRestriction searchRestriction,
int startIndex,
int maxResults)
Searches for users (with their attributes) matching the following criteria.
|
void |
shutdown()
Closes this Crowd Client and releases any system resources associated
with the client.
|
void |
storeGroupAttributes(String groupName,
Map<String,Set<String>> attributes)
Stores the group's attributes on the remote Crowd server.
|
void |
storeUserAttributes(String username,
Map<String,Set<String>> attributes)
Stores the user's attributes on the remote Crowd server.
|
void |
testConnection()
Tests if the connection is OK.
|
void |
unregisterWebhook(long webhookId)
Unregisters a Webhook on the server.
|
void |
updateGroup(Group group)
Updates a group on the remote Crowd server.
|
void |
updateUser(User user)
Updates a user on the remote Crowd server.
|
void |
updateUserCredential(String username,
String password)
Updates the user's password on the remote Crowd server.
|
User |
userAuthenticated(String username) |
void |
validateSSOAuthentication(String token,
List<ValidationFactor> validationFactors)
Validates the SSO authentication.
|
Session |
validateSSOAuthenticationAndGetSession(String token,
List<ValidationFactor> validationFactors)
Validates the SSO authentication.
|
@Deprecated public RestCrowdClient(ClientProperties clientProperties)
RestCrowdClientFactory
methodsclientProperties
- crowd properties for the clientpublic RestCrowdClient(RestExecutor executor)
RestCrowdClientFactory
instead.public User getUser(String name) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getUser
in interface CrowdClient
name
- Name of the user to retrieveUserNotFoundException
- 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.public UserWithAttributes getUserWithAttributes(String name) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getUserWithAttributes
in interface CrowdClient
name
- Name of the user to retrieveUserNotFoundException
- 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.public User getUserByKey(String key) throws UserNotFoundException, OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException
CrowdClient
getUserByKey
in interface CrowdClient
key
- Name of the user to retrieveUserNotFoundException
- 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 validpublic User authenticateUser(String username, String password) throws UserNotFoundException, InactiveAccountException, ExpiredCredentialException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
authenticateUser
in interface CrowdClient
username
- Name of the user to authenticate.password
- Password of the user to authenticate.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.public User userAuthenticated(String username) throws ApplicationPermissionException, OperationFailedException, InvalidAuthenticationException, UserNotFoundException, InactiveAccountException
userAuthenticated
in interface CrowdClient
ApplicationPermissionException
OperationFailedException
InvalidAuthenticationException
UserNotFoundException
InactiveAccountException
public UserWithAttributes addUser(UserWithAttributes user, PasswordCredential passwordCredential) throws ApplicationPermissionException, InvalidUserException, InvalidCredentialException, InvalidAuthenticationException, OperationFailedException
CrowdClient
CrowdClient.storeUserAttributes(String, Map)
afterwards.addUser
in interface CrowdClient
user
- The user to addpasswordCredential
- user passwordApplicationPermissionException
- 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.public UserWithAttributes addUser(User user, PasswordCredential passwordCredential) throws ApplicationPermissionException, InvalidUserException, InvalidCredentialException, InvalidAuthenticationException, OperationFailedException
CrowdClient
addUser
in interface CrowdClient
user
- The user to addpasswordCredential
- user passwordApplicationPermissionException
- 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.public void updateUser(User user) throws InvalidUserException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
updateUser
in interface CrowdClient
user
- The user to updateInvalidUserException
- 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.public User renameUser(String oldUsername, String newUsername) throws InvalidUserException, UserNotFoundException, OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException
CrowdClient
renameUser
in interface CrowdClient
oldUsername
- current name of the user to renamenewUsername
- the intended new name of the user; must not be the same as oldUsername
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 validpublic void updateUserCredential(String username, String password) throws InvalidCredentialException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
updateUserCredential
in interface CrowdClient
username
- Name of the user to update.password
- New password. A null value indicates that the user's password should be cleared.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.public void requestPasswordReset(String username) throws UserNotFoundException, InvalidEmailAddressException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
requestPasswordReset
in interface CrowdClient
username
- name of the userUserNotFoundException
- 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.public void requestUsernames(String email) throws InvalidEmailAddressException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
email
.requestUsernames
in interface CrowdClient
email
- email address of the userInvalidEmailAddressException
- if the email
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.public void storeUserAttributes(String username, Map<String,Set<String>> attributes) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
storeUserAttributes
in interface CrowdClient
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.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.public void removeUserAttributes(String username, String attributeName) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
removeUserAttributes
in interface CrowdClient
username
- Name of the userattributeName
- Attribute key.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.public void removeUser(String username) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
removeUser
in interface CrowdClient
username
- Name of the user to remove.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.public Group getGroup(String name) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
getGroup
in interface CrowdClient
name
- name of the group to retrieve.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 validpublic GroupWithAttributes getGroupWithAttributes(String name) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getGroupWithAttributes
in interface CrowdClient
name
- name of the group to retrieve.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.public void addGroup(Group group) throws InvalidGroupException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
addGroup
in interface CrowdClient
group
- Group to add.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.public void updateGroup(Group group) throws InvalidGroupException, GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
updateGroup
in interface CrowdClient
group
- Group to update.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.public void storeGroupAttributes(String groupName, Map<String,Set<String>> attributes) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
storeGroupAttributes
in interface CrowdClient
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.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.public void removeGroupAttributes(String groupName, String attributeName) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
removeGroupAttributes
in interface CrowdClient
groupName
- Name of the groupattributeName
- Attribute key.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.public void removeGroup(String groupName) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
removeGroup
in interface CrowdClient
groupName
- Name of the group to remove.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.public boolean isUserDirectGroupMember(String username, String groupName) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
isUserDirectGroupMember
in interface CrowdClient
username
- User namegroupName
- Group NameApplicationPermissionException
- 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.public boolean isUserNestedGroupMember(String username, String groupName) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
isUserNestedGroupMember
in interface CrowdClient
username
- User namegroupName
- Group NameApplicationPermissionException
- 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.public boolean isGroupDirectGroupMember(String childName, String parentName) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
isGroupDirectGroupMember
in interface CrowdClient
childName
- Name of the child groupparentName
- Name of the Parent groupApplicationPermissionException
- 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.public void addUserToGroup(String username, String groupName) throws GroupNotFoundException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, MembershipAlreadyExistsException
CrowdClient
addUserToGroup
in interface CrowdClient
username
- Name of the user to add to the group.groupName
- Name of the group to be added to.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 grouppublic void addGroupToGroup(String childGroup, String parentGroup) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, MembershipAlreadyExistsException
CrowdClient
addGroupToGroup
in interface CrowdClient
childGroup
- Name of the group to add to the parent group.parentGroup
- Name of the group the child will be added to.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 grouppublic void removeUserFromGroup(String username, String groupName) throws MembershipNotFoundException, GroupNotFoundException, UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
removeUserFromGroup
in interface CrowdClient
username
- Name of the user to add to the group.groupName
- Name of the group to be added to.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.public void removeGroupFromGroup(String childGroup, String parentGroup) throws MembershipNotFoundException, GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
removeGroupFromGroup
in interface CrowdClient
childGroup
- Name of the group to be removed from the parent group.parentGroup
- Name of the group the child group will be removed from.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 failedpublic void testConnection() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
testConnection
in interface CrowdClient
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 failspublic List<User> searchUsers(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
searchUsers
in interface CrowdClient
searchRestriction
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchApplicationPermissionException
- 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.public List<UserWithAttributes> searchUsersWithAttributes(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
searchUsersWithAttributes
in interface CrowdClient
searchRestriction
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchApplicationPermissionException
- 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.public List<String> searchUserNames(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
searchUserNames
in interface CrowdClient
searchRestriction
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchApplicationPermissionException
- 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.public List<Group> searchGroups(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
searchGroups
in interface CrowdClient
searchRestriction
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchApplicationPermissionException
- 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.public List<GroupWithAttributes> searchGroupsWithAttributes(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
searchGroupsWithAttributes
in interface CrowdClient
searchRestriction
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchApplicationPermissionException
- 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.public List<String> searchGroupNames(SearchRestriction searchRestriction, int startIndex, int maxResults) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
searchGroupNames
in interface CrowdClient
searchRestriction
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchApplicationPermissionException
- 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.public List<User> getUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getUsersOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<String> getNamesOfUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfUsersOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<Group> getChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getChildGroupsOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<String> getNamesOfChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfChildGroupsOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<Group> getGroupsForUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getGroupsForUser
in interface CrowdClient
userName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchUserNotFoundException
- 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.public List<GroupWithAttributes> getGroupsWithAttributesForUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
CrowdClient.getGroupsForUser(java.lang.String, int, int)
.getGroupsWithAttributesForUser
in interface CrowdClient
userName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchUserNotFoundException
- 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.public List<String> getNamesOfGroupsForUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfGroupsForUser
in interface CrowdClient
userName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchUserNotFoundException
- 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.public List<Group> getParentGroupsForGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getParentGroupsForGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<String> getNamesOfParentGroupsForGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfParentGroupsForGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<User> getNestedUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNestedUsersOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<String> getNamesOfNestedUsersOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfNestedUsersOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<Group> getNestedChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNestedChildGroupsOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<String> getNamesOfNestedChildGroupsOfGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfNestedChildGroupsOfGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<Group> getGroupsForNestedUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getGroupsForNestedUser
in interface CrowdClient
userName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchUserNotFoundException
- 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.public List<String> getNamesOfGroupsForNestedUser(String userName, int startIndex, int maxResults) throws UserNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfGroupsForNestedUser
in interface CrowdClient
userName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchUserNotFoundException
- 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.public List<Group> getParentGroupsForNestedGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getParentGroupsForNestedGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public List<String> getNamesOfParentGroupsForNestedGroup(String groupName, int startIndex, int maxResults) throws GroupNotFoundException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getNamesOfParentGroupsForNestedGroup
in interface CrowdClient
groupName
- restriction on the searchstartIndex
- starting index of the search resultsmaxResults
- maximum number of results returned from the searchGroupNotFoundException
- 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.public Iterable<Membership> getMemberships() throws OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException, UnsupportedCrowdApiException
CrowdClient
Gets 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 UnsupportedCrowdApiException
and fall back to another technique
if they need to remain backwards compatible.
getMemberships
in interface CrowdClient
Iterable
of the memberships for all groupsUnsupportedCrowdApiException
- if the server does not support version 1.1 of the user management APIOperationFailedException
- 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 validpublic User findUserFromSSOToken(String token) throws InvalidTokenException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
findUserFromSSOToken
in interface CrowdClient
token
- user token used to find the authenticated user.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.public String authenticateSSOUser(UserAuthenticationContext userAuthenticationContext) throws ApplicationAccessDeniedException, ExpiredCredentialException, InactiveAccountException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
authenticateSSOUser
in interface CrowdClient
userAuthenticationContext
- the user's authentication details.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.public String authenticateSSOUser(UserAuthenticationContext userAuthenticationContext, long duration) throws ApplicationAccessDeniedException, ExpiredCredentialException, InactiveAccountException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
authenticateSSOUser
in interface CrowdClient
userAuthenticationContext
- the user's authentication details.duration
- requested duration of the new token (in seconds)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.public String authenticateSSOUserWithoutValidatingPassword(UserAuthenticationContext userAuthenticationContext) throws ApplicationAccessDeniedException, InactiveAccountException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
authenticateSSOUserWithoutValidatingPassword
in interface CrowdClient
userAuthenticationContext
- the user's authentication details.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.public void validateSSOAuthentication(String token, List<ValidationFactor> validationFactors) throws InvalidTokenException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
validateSSOAuthentication
in interface CrowdClient
token
- Crowd SSO tokenvalidationFactors
- Details of where the user's come from. If presented, must match those presented during authentication.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.public Session validateSSOAuthenticationAndGetSession(String token, List<ValidationFactor> validationFactors) throws InvalidTokenException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
validateSSOAuthenticationAndGetSession
in interface CrowdClient
token
- Crowd SSO tokenvalidationFactors
- Details of where the user's come from. If presented, must match those presented during authentication.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.public void invalidateSSOToken(String token) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
invalidateSSOToken
in interface CrowdClient
token
- a non-empty token to invalidateApplicationPermissionException
- 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.public void invalidateSSOTokensForUser(String username) throws OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException, UnsupportedCrowdApiException
CrowdClient
invalidateSSOTokensForUser
in interface CrowdClient
username
- User whose sessions will be invalidatedUnsupportedCrowdApiException
- if the remote server does not support this operationOperationFailedException
- 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 validpublic void invalidateSSOTokensForUser(String username, String exclude) throws OperationFailedException, ApplicationPermissionException, InvalidAuthenticationException, UnsupportedCrowdApiException
CrowdClient
invalidateSSOTokensForUser
in interface CrowdClient
username
- User whose sessions will be invalidatedexclude
- Token to be savedUnsupportedCrowdApiException
- if the remote server does not support this operationOperationFailedException
- 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 validpublic CookieConfiguration getCookieConfiguration() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
getCookieConfiguration
in interface CrowdClient
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.public void shutdown()
CrowdClient
The client can no longer be used once shutdown.
Calling this method more than once will have no effect.
shutdown
in interface CrowdClient
public String getCurrentEventToken() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, IncrementalSynchronisationNotAvailableException
CrowdClient
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.
getCurrentEventToken
in interface CrowdClient
ApplicationPermissionException
- if the application is not permitted to perform the requested operation on the server.InvalidAuthenticationException
- if the application and password are not valid.UnsupportedCrowdApiException
- if the remote server does not support this operationOperationFailedException
- if the operation has failed for any other reason, including invalid argumentsIncrementalSynchronisationNotAvailableException
- if the application cannot provide incremental synchronisationpublic Events getNewEvents(String eventToken) throws EventTokenExpiredException, ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
eventToken
was generated.
If for any reason event store is unable to retrieve events that happened
after the event token was generated, an
EventTokenExpiredException
will be thrown. The caller is then
expected to call CrowdClient.getCurrentEventToken()
again before asking for
new events.
getNewEvents
in interface CrowdClient
eventToken
- event token that was retrieved by a call to CrowdClient.getCurrentEventToken()
or this methodeventToken
was generatedEventTokenExpiredException
- 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.UnsupportedCrowdApiException
- if the remote server does not support this operationOperationFailedException
- if the operation has failed for any other reason, including invalid argumentspublic String getWebhook(long webhookId) throws InvalidAuthenticationException, ApplicationPermissionException, OperationFailedException, WebhookNotFoundException
CrowdClient
getWebhook
in interface CrowdClient
webhookId
- a Webhook identifier, as returned by CrowdClient.registerWebhook(String, String)
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 registeredpublic long registerWebhook(String endpointUrl, @Nullable String token) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
CrowdClient.getCurrentEventToken()
after registering
a Webhook, so then can obtain the new events using CrowdClient.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.
registerWebhook
in interface CrowdClient
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).CrowdClient.unregisterWebhook(long)
.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.public void unregisterWebhook(long webhookId) throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException, WebhookNotFoundException
CrowdClient
CrowdClient.registerWebhook(String, String)
.unregisterWebhook
in interface CrowdClient
webhookId
- The identifier of the Webhook returned by CrowdClient.registerWebhook(String, String)
.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 operationpublic void expireAllPasswords() throws ApplicationPermissionException, InvalidAuthenticationException, OperationFailedException
CrowdClient
expireAllPasswords
in interface CrowdClient
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.Copyright © 2021 Atlassian. All rights reserved.