com.atlassian.crowd.integration.rest.service
Class RestCrowdClient

java.lang.Object
  extended by com.atlassian.crowd.integration.rest.service.RestCrowdClient
All Implemented Interfaces:
CrowdClient

public class RestCrowdClient
extends java.lang.Object
implements CrowdClient

This is the Crowd Client to access REST services on a remote Crowd Server.


Constructor Summary
RestCrowdClient(ClientProperties clientProperties)
          Constructs a new REST Crowd Client instance.
 
Method Summary
 void addGroup(Group group)
          Adds a group to the remote Crowd server.
 void addGroupToGroup(java.lang.String childGroup, java.lang.String parentGroup)
          Adds a group to a group.
 void addUser(User user, PasswordCredential passwordCredential)
          Adds a new User to the remote Crowd server.
 void addUserToGroup(java.lang.String username, java.lang.String groupName)
          Adds a user to a group.
 java.lang.String authenticateSSOUser(UserAuthenticationContext userAuthenticationContext)
          Authenticates a Single-Sign-On (SSO) User.
 java.lang.String authenticateSSOUserWithoutValidatingPassword(UserAuthenticationContext userAuthenticationContext)
          Authenticates a Single-Sign-On (SSO) User without validating password.
 User authenticateUser(java.lang.String username, java.lang.String password)
          Authenticates a user with the server.
 User findUserFromSSOToken(java.lang.String token)
          Returns the user from the specified user token.
 java.util.List<Group> getChildGroupsOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups who are direct members of a group.
 CookieConfiguration getCookieConfiguration()
          Returns the cookie configuration.
 Group getGroup(java.lang.String name)
          Get a group by name.
 java.util.List<Group> getGroupsForNestedUser(java.lang.String userName, int startIndex, int maxResults)
          Searches for groups that a user is a nested member of.
 java.util.List<Group> getGroupsForUser(java.lang.String userName, int startIndex, int maxResults)
          Searches for groups that a user is a direct member of.
 GroupWithAttributes getGroupWithAttributes(java.lang.String name)
          Gets a group with attributes by name.
 java.util.List<java.lang.String> getNamesOfChildGroupsOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups who are direct members of a group, returning the group names.
 java.util.List<java.lang.String> getNamesOfGroupsForNestedUser(java.lang.String userName, int startIndex, int maxResults)
          Searches for groups that a user is a nested member of, returning the group names.
 java.util.List<java.lang.String> getNamesOfGroupsForUser(java.lang.String userName, int startIndex, int maxResults)
          Searches for groups that a user is a direct member of, returning the group names.
 java.util.List<java.lang.String> getNamesOfNestedChildGroupsOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups who are nested members of a group, returning the group names.
 java.util.List<java.lang.String> getNamesOfNestedUsersOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for users who are nested members of a group, returning the user names.
 java.util.List<java.lang.String> getNamesOfParentGroupsForGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups that a group is a direct member of, returning the group names.
 java.util.List<java.lang.String> getNamesOfParentGroupsForNestedGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups that a group is a nested member of, returning the group names.
 java.util.List<java.lang.String> getNamesOfUsersOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for users who are direct members of a group, returning the user names.
 java.util.List<Group> getNestedChildGroupsOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups who are nested members of a group.
 java.util.List<User> getNestedUsersOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for users who are nested members of a group.
 java.util.List<Group> getParentGroupsForGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups that a group is a direct member of.
 java.util.List<Group> getParentGroupsForNestedGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for groups that a group is a nested member of.
 User getUser(java.lang.String name)
          Gets a User by user name.
 java.util.List<User> getUsersOfGroup(java.lang.String groupName, int startIndex, int maxResults)
          Searches for users who are direct members of a group.
 UserWithAttributes getUserWithAttributes(java.lang.String name)
          Gets a User with Attributes by user name.
 void invalidateSSOToken(java.lang.String token)
          Invalidates a token.
 boolean isGroupDirectGroupMember(java.lang.String childName, java.lang.String parentName)
          Tests if a group is a direct member of a group.
 boolean isUserDirectGroupMember(java.lang.String username, java.lang.String groupName)
          Tests if a user is a direct member of a group.
 boolean isUserNestedGroupMember(java.lang.String username, java.lang.String groupName)
          Tests if a user is a nested member of a group.
 void removeGroup(java.lang.String groupName)
          Removes a group from the remote Crowd server
 void removeGroupAttributes(java.lang.String groupName, java.lang.String attributeName)
          Removes a group attribute (set) from the server.
 void removeGroupFromGroup(java.lang.String childGroup, java.lang.String parentGroup)
          Removes a group to a group.
 void removeUser(java.lang.String username)
          Removes a user from the remote Crowd server
 void removeUserAttributes(java.lang.String username, java.lang.String attributeName)
          Removes a user attribute from the server.
 void removeUserFromGroup(java.lang.String username, java.lang.String groupName)
          Removes a user from a group.
 void requestPasswordReset(java.lang.String username)
          Requests a password reset.
 void requestUsernames(java.lang.String email)
          Sends the usernames associated with the given email address.
 java.util.List<java.lang.String> searchGroupNames(SearchRestriction searchRestriction, int startIndex, int maxResults)
          Searches for group names matching the searchRestriction criteria.
 java.util.List<Group> searchGroups(SearchRestriction searchRestriction, int startIndex, int maxResults)
          Searches for groups matching the following criteria.
 java.util.List<java.lang.String> searchUserNames(SearchRestriction searchRestriction, int startIndex, int maxResults)
          Searches for usernames matching the searchRestriction criteria.
 java.util.List<User> searchUsers(SearchRestriction searchRestriction, int startIndex, int maxResults)
          Searches for users matching the following criteria.
 void storeGroupAttributes(java.lang.String groupName, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
          Stores the group's attributes on the remote Crowd server.
 void storeUserAttributes(java.lang.String username, java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
          Stores the user's attributes on the remote Crowd server.
 void testConnection()
          Tests if the connection is OK.
 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(java.lang.String username, java.lang.String password)
          Updates the user's password on the remote Crowd server.
 void validateSSOAuthentication(java.lang.String token, java.util.List<ValidationFactor> validationFactors)
          Validates the SSO authentication.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RestCrowdClient

public RestCrowdClient(ClientProperties clientProperties)
Constructs 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
Method Detail

getUser

public User getUser(java.lang.String name)
             throws UserNotFoundException,
                    ApplicationPermissionException,
                    InvalidAuthenticationException,
                    OperationFailedException
Description copied from interface: CrowdClient
Gets a User by user name.

Specified by:
getUser in interface CrowdClient
Parameters:
name - Name of the user to retrieve
Returns:
A User.
Throws:
UserNotFoundException - if the user is not found
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 an unknown reason

getUserWithAttributes

public UserWithAttributes getUserWithAttributes(java.lang.String name)
                                         throws UserNotFoundException,
                                                ApplicationPermissionException,
                                                InvalidAuthenticationException,
                                                OperationFailedException
Description copied from interface: CrowdClient
Gets a User with Attributes by user name.

Specified by:
getUserWithAttributes in interface CrowdClient
Parameters:
name - Name of the user to retrieve
Returns:
A User.
Throws:
UserNotFoundException - if the user is not found
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 an unknown reason

authenticateUser

public User authenticateUser(java.lang.String username,
                             java.lang.String password)
                      throws UserNotFoundException,
                             InactiveAccountException,
                             ExpiredCredentialException,
                             ApplicationPermissionException,
                             InvalidAuthenticationException,
                             OperationFailedException
Description copied from interface: CrowdClient
Authenticates a user with the server.

Specified by:
authenticateUser in interface CrowdClient
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 found
InactiveAccountException - if the user account is not active
ExpiredCredentialException - if the user credentials have expired
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 an unknown reason

addUser

public void addUser(User user,
                    PasswordCredential passwordCredential)
             throws ApplicationPermissionException,
                    InvalidUserException,
                    InvalidCredentialException,
                    InvalidAuthenticationException,
                    OperationFailedException
Description copied from interface: CrowdClient
Adds a new User to the remote Crowd server.

Specified by:
addUser in interface CrowdClient
Parameters:
user - The user to add
passwordCredential - user password
Throws:
ApplicationPermissionException - if the application is not permitted to perform the requested operation on the server
InvalidUserException - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

updateUser

public void updateUser(User user)
                throws InvalidUserException,
                       UserNotFoundException,
                       ApplicationPermissionException,
                       InvalidAuthenticationException,
                       OperationFailedException
Description copied from interface: CrowdClient
Updates a user on the remote Crowd server.

Specified by:
updateUser in interface CrowdClient
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 server
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 an unknown reason

updateUserCredential

public void updateUserCredential(java.lang.String username,
                                 java.lang.String password)
                          throws InvalidCredentialException,
                                 UserNotFoundException,
                                 ApplicationPermissionException,
                                 InvalidAuthenticationException,
                                 OperationFailedException
Description copied from interface: CrowdClient
Updates the user's password on the remote Crowd server.

Specified by:
updateUserCredential in interface CrowdClient
Parameters:
username - Name of the user to update.
password - New password.
Throws:
InvalidCredentialException - if the password is invalid. It must conform to the rules set on the server
UserNotFoundException - if the user does not exist on the remote Crowd server
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 an unknown reason

requestPasswordReset

public void requestPasswordReset(java.lang.String username)
                          throws UserNotFoundException,
                                 InvalidEmailAddressException,
                                 ApplicationPermissionException,
                                 InvalidAuthenticationException,
                                 OperationFailedException
Description copied from interface: CrowdClient
Requests a password reset.

Specified by:
requestPasswordReset in interface CrowdClient
Parameters:
username - name of the user
Throws:
UserNotFoundException - if the user does not exist
InvalidEmailAddressException - if the user does not have a valid email to send the reset password link to
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 an unknown reason

requestUsernames

public void requestUsernames(java.lang.String email)
                      throws InvalidEmailAddressException,
                             ApplicationPermissionException,
                             InvalidAuthenticationException,
                             OperationFailedException
Description copied from interface: CrowdClient
Sends the usernames associated with the given email address. No email will be sent if there are no usernames associated with a given email.

Specified by:
requestUsernames in interface CrowdClient
Parameters:
email - email address of the user
Throws:
InvalidEmailAddressException - if the email is not valid
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 an unknown reason

storeUserAttributes

public void storeUserAttributes(java.lang.String username,
                                java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
                         throws UserNotFoundException,
                                ApplicationPermissionException,
                                InvalidAuthenticationException,
                                OperationFailedException
Description copied from interface: CrowdClient
Stores the user's attributes on the remote Crowd server.

Specified by:
storeUserAttributes in interface CrowdClient
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 server
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 an unknown reason

removeUserAttributes

public void removeUserAttributes(java.lang.String username,
                                 java.lang.String attributeName)
                          throws UserNotFoundException,
                                 ApplicationPermissionException,
                                 InvalidAuthenticationException,
                                 OperationFailedException
Description copied from interface: CrowdClient
Removes a user attribute from the server. If the attribute to be removed does not exist, no error is reported.

Specified by:
removeUserAttributes in interface CrowdClient
Parameters:
username - Name of the user
attributeName - Attribute key.
Throws:
UserNotFoundException - if the user does not exist on the remote Crowd server
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 an unknown reason

removeUser

public void removeUser(java.lang.String username)
                throws UserNotFoundException,
                       ApplicationPermissionException,
                       InvalidAuthenticationException,
                       OperationFailedException
Description copied from interface: CrowdClient
Removes a user from the remote Crowd server

Specified by:
removeUser in interface CrowdClient
Parameters:
username - Name of the user to remove.
Throws:
UserNotFoundException - if the user does not exist on the remote Crowd server
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 an unknown reason

getGroup

public Group getGroup(java.lang.String name)
               throws GroupNotFoundException,
                      ApplicationPermissionException,
                      InvalidAuthenticationException,
                      OperationFailedException
Get a group by name.

Specified by:
getGroup in interface CrowdClient
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 server
InvalidAuthenticationException - if the application and password are not valid

getGroupWithAttributes

public GroupWithAttributes getGroupWithAttributes(java.lang.String name)
                                           throws GroupNotFoundException,
                                                  ApplicationPermissionException,
                                                  InvalidAuthenticationException,
                                                  OperationFailedException
Description copied from interface: CrowdClient
Gets a group with attributes by name.

Specified by:
getGroupWithAttributes in interface CrowdClient
Parameters:
name - name of the group to retrieve.
Returns:
A Group with attributes.
Throws:
GroupNotFoundException - if the group does not exist on the remote server
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 an unknown reason

addGroup

public void addGroup(Group group)
              throws InvalidGroupException,
                     ApplicationPermissionException,
                     InvalidAuthenticationException,
                     OperationFailedException
Description copied from interface: CrowdClient
Adds a group to the remote Crowd server.

Specified by:
addGroup in interface CrowdClient
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 rules
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 an unknown reason

updateGroup

public void updateGroup(Group group)
                 throws InvalidGroupException,
                        GroupNotFoundException,
                        ApplicationPermissionException,
                        InvalidAuthenticationException,
                        OperationFailedException
Description copied from interface: CrowdClient
Updates a group on the remote Crowd server.

Specified by:
updateGroup in interface CrowdClient
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 server
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 an unknown reason

storeGroupAttributes

public void storeGroupAttributes(java.lang.String groupName,
                                 java.util.Map<java.lang.String,java.util.Set<java.lang.String>> attributes)
                          throws GroupNotFoundException,
                                 ApplicationPermissionException,
                                 InvalidAuthenticationException,
                                 OperationFailedException
Description copied from interface: CrowdClient
Stores the group's attributes on the remote Crowd server.

Specified by:
storeGroupAttributes in interface CrowdClient
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 server
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 an unknown reason

removeGroupAttributes

public void removeGroupAttributes(java.lang.String groupName,
                                  java.lang.String attributeName)
                           throws GroupNotFoundException,
                                  ApplicationPermissionException,
                                  InvalidAuthenticationException,
                                  OperationFailedException
Description copied from interface: CrowdClient
Removes a group attribute (set) from the server. If the attribute to be removed does not exist, no error is reported.

Specified by:
removeGroupAttributes in interface CrowdClient
Parameters:
groupName - Name of the group
attributeName - Attribute key.
Throws:
GroupNotFoundException - the group does not exist on the remote Crowd server
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 an unknown reason

removeGroup

public void removeGroup(java.lang.String groupName)
                 throws GroupNotFoundException,
                        ApplicationPermissionException,
                        InvalidAuthenticationException,
                        OperationFailedException
Description copied from interface: CrowdClient
Removes a group from the remote Crowd server

Specified by:
removeGroup in interface CrowdClient
Parameters:
groupName - Name of the group to remove.
Throws:
GroupNotFoundException - the group does not exist on the remote Crowd server
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 an unknown reason

isUserDirectGroupMember

public boolean isUserDirectGroupMember(java.lang.String username,
                                       java.lang.String groupName)
                                throws ApplicationPermissionException,
                                       InvalidAuthenticationException,
                                       OperationFailedException
Description copied from interface: CrowdClient
Tests if a user is a direct member of a group.

Specified by:
isUserDirectGroupMember in interface CrowdClient
Parameters:
username - User name
groupName - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

isUserNestedGroupMember

public boolean isUserNestedGroupMember(java.lang.String username,
                                       java.lang.String groupName)
                                throws ApplicationPermissionException,
                                       InvalidAuthenticationException,
                                       OperationFailedException
Description copied from interface: CrowdClient
Tests if a user is a nested member of a group.

Specified by:
isUserNestedGroupMember in interface CrowdClient
Parameters:
username - User name
groupName - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

isGroupDirectGroupMember

public boolean isGroupDirectGroupMember(java.lang.String childName,
                                        java.lang.String parentName)
                                 throws ApplicationPermissionException,
                                        InvalidAuthenticationException,
                                        OperationFailedException
Description copied from interface: CrowdClient
Tests if a group is a direct member of a group.

Specified by:
isGroupDirectGroupMember in interface CrowdClient
Parameters:
childName - Name of the child group
parentName - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

addUserToGroup

public void addUserToGroup(java.lang.String username,
                           java.lang.String groupName)
                    throws GroupNotFoundException,
                           UserNotFoundException,
                           ApplicationPermissionException,
                           InvalidAuthenticationException,
                           OperationFailedException
Description copied from interface: CrowdClient
Adds a user to a group.

Specified by:
addUserToGroup in interface CrowdClient
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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

addGroupToGroup

public void addGroupToGroup(java.lang.String childGroup,
                            java.lang.String parentGroup)
                     throws GroupNotFoundException,
                            ApplicationPermissionException,
                            InvalidAuthenticationException,
                            OperationFailedException
Description copied from interface: CrowdClient
Adds a group to a group.

Specified by:
addGroupToGroup in interface CrowdClient
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 exist
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 an unknown reason

removeUserFromGroup

public void removeUserFromGroup(java.lang.String username,
                                java.lang.String groupName)
                         throws MembershipNotFoundException,
                                GroupNotFoundException,
                                UserNotFoundException,
                                ApplicationPermissionException,
                                InvalidAuthenticationException,
                                OperationFailedException
Description copied from interface: CrowdClient
Removes a user from a group.

Specified by:
removeUserFromGroup in interface CrowdClient
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 exist
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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

removeGroupFromGroup

public void removeGroupFromGroup(java.lang.String childGroup,
                                 java.lang.String parentGroup)
                          throws MembershipNotFoundException,
                                 GroupNotFoundException,
                                 ApplicationPermissionException,
                                 InvalidAuthenticationException,
                                 OperationFailedException
Description copied from interface: CrowdClient
Removes a group to a group.

Specified by:
removeGroupFromGroup in interface CrowdClient
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 groups
GroupNotFoundException - if either group does not exist.
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 for some reason the operation has failed

testConnection

public void testConnection()
                    throws ApplicationPermissionException,
                           InvalidAuthenticationException,
                           OperationFailedException
Description copied from interface: CrowdClient
Tests 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:
testConnection in interface CrowdClient
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 test fails

searchUsers

public java.util.List<User> searchUsers(SearchRestriction searchRestriction,
                                        int startIndex,
                                        int maxResults)
                                 throws ApplicationPermissionException,
                                        InvalidAuthenticationException,
                                        OperationFailedException
Description copied from interface: CrowdClient
Searches for users matching the following criteria.

Specified by:
searchUsers in interface CrowdClient
Parameters:
searchRestriction - restriction on the search
startIndex - starting index of the search results
maxResults - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

searchUserNames

public java.util.List<java.lang.String> searchUserNames(SearchRestriction searchRestriction,
                                                        int startIndex,
                                                        int maxResults)
                                                 throws ApplicationPermissionException,
                                                        InvalidAuthenticationException,
                                                        OperationFailedException
Description copied from interface: CrowdClient
Searches for usernames matching the searchRestriction criteria.

Specified by:
searchUserNames in interface CrowdClient
Parameters:
searchRestriction - restriction on the search
startIndex - starting index of the search results
maxResults - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

searchGroups

public java.util.List<Group> searchGroups(SearchRestriction searchRestriction,
                                          int startIndex,
                                          int maxResults)
                                   throws ApplicationPermissionException,
                                          InvalidAuthenticationException,
                                          OperationFailedException
Description copied from interface: CrowdClient
Searches for groups matching the following criteria.

Specified by:
searchGroups in interface CrowdClient
Parameters:
searchRestriction - restriction on the search
startIndex - starting index of the search results
maxResults - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

searchGroupNames

public java.util.List<java.lang.String> searchGroupNames(SearchRestriction searchRestriction,
                                                         int startIndex,
                                                         int maxResults)
                                                  throws ApplicationPermissionException,
                                                         InvalidAuthenticationException,
                                                         OperationFailedException
Description copied from interface: CrowdClient
Searches for group names matching the searchRestriction criteria.

Specified by:
searchGroupNames in interface CrowdClient
Parameters:
searchRestriction - restriction on the search
startIndex - starting index of the search results
maxResults - 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 server
InvalidAuthenticationException - if the application and password are not valid
OperationFailedException - if the operation has failed for an unknown reason

getUsersOfGroup

public java.util.List<User> getUsersOfGroup(java.lang.String groupName,
                                            int startIndex,
                                            int maxResults)
                                     throws GroupNotFoundException,
                                            ApplicationPermissionException,
                                            InvalidAuthenticationException,
                                            OperationFailedException
Description copied from interface: CrowdClient
Searches for users who are direct members of a group.

Specified by:
getUsersOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of users satisfying the search restriction.
Throws:
GroupNotFoundException - if the group could not be found
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 an unknown reason

getNamesOfUsersOfGroup

public java.util.List<java.lang.String> getNamesOfUsersOfGroup(java.lang.String groupName,
                                                               int startIndex,
                                                               int maxResults)
                                                        throws GroupNotFoundException,
                                                               ApplicationPermissionException,
                                                               InvalidAuthenticationException,
                                                               OperationFailedException
Description copied from interface: CrowdClient
Searches for users who are direct members of a group, returning the user names.

Specified by:
getNamesOfUsersOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

getChildGroupsOfGroup

public java.util.List<Group> getChildGroupsOfGroup(java.lang.String groupName,
                                                   int startIndex,
                                                   int maxResults)
                                            throws GroupNotFoundException,
                                                   ApplicationPermissionException,
                                                   InvalidAuthenticationException,
                                                   OperationFailedException
Description copied from interface: CrowdClient
Searches for groups who are direct members of a group.

Specified by:
getChildGroupsOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of groups satisfying the search restrictions
Throws:
GroupNotFoundException - if the group could not be found
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 an unknown reason

getNamesOfChildGroupsOfGroup

public java.util.List<java.lang.String> getNamesOfChildGroupsOfGroup(java.lang.String groupName,
                                                                     int startIndex,
                                                                     int maxResults)
                                                              throws GroupNotFoundException,
                                                                     ApplicationPermissionException,
                                                                     InvalidAuthenticationException,
                                                                     OperationFailedException
Description copied from interface: CrowdClient
Searches for groups who are direct members of a group, returning the group names.

Specified by:
getNamesOfChildGroupsOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

getGroupsForUser

public java.util.List<Group> getGroupsForUser(java.lang.String userName,
                                              int startIndex,
                                              int maxResults)
                                       throws UserNotFoundException,
                                              ApplicationPermissionException,
                                              InvalidAuthenticationException,
                                              OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a user is a direct member of.

Specified by:
getGroupsForUser in interface CrowdClient
Parameters:
userName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of groups satisfying the search restriction.
Throws:
UserNotFoundException - if the user could not be found
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 an unknown reason

getNamesOfGroupsForUser

public java.util.List<java.lang.String> getNamesOfGroupsForUser(java.lang.String userName,
                                                                int startIndex,
                                                                int maxResults)
                                                         throws UserNotFoundException,
                                                                ApplicationPermissionException,
                                                                InvalidAuthenticationException,
                                                                OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a user is a direct member of, returning the group names.

Specified by:
getNamesOfGroupsForUser in interface CrowdClient
Parameters:
userName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

getParentGroupsForGroup

public java.util.List<Group> getParentGroupsForGroup(java.lang.String groupName,
                                                     int startIndex,
                                                     int maxResults)
                                              throws GroupNotFoundException,
                                                     ApplicationPermissionException,
                                                     InvalidAuthenticationException,
                                                     OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a group is a direct member of.

Specified by:
getParentGroupsForGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of groups satisfying the search restriction.
Throws:
GroupNotFoundException - if the group could not be found
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 an unknown reason

getNamesOfParentGroupsForGroup

public java.util.List<java.lang.String> getNamesOfParentGroupsForGroup(java.lang.String groupName,
                                                                       int startIndex,
                                                                       int maxResults)
                                                                throws GroupNotFoundException,
                                                                       ApplicationPermissionException,
                                                                       InvalidAuthenticationException,
                                                                       OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a group is a direct member of, returning the group names.

Specified by:
getNamesOfParentGroupsForGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

getNestedUsersOfGroup

public java.util.List<User> getNestedUsersOfGroup(java.lang.String groupName,
                                                  int startIndex,
                                                  int maxResults)
                                           throws GroupNotFoundException,
                                                  ApplicationPermissionException,
                                                  InvalidAuthenticationException,
                                                  OperationFailedException
Description copied from interface: CrowdClient
Searches for users who are nested members of a group.

Specified by:
getNestedUsersOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of users satisfying the search restriction.
Throws:
GroupNotFoundException - if the group could not be found
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 an unknown reason

getNamesOfNestedUsersOfGroup

public java.util.List<java.lang.String> getNamesOfNestedUsersOfGroup(java.lang.String groupName,
                                                                     int startIndex,
                                                                     int maxResults)
                                                              throws GroupNotFoundException,
                                                                     ApplicationPermissionException,
                                                                     InvalidAuthenticationException,
                                                                     OperationFailedException
Description copied from interface: CrowdClient
Searches for users who are nested members of a group, returning the user names.

Specified by:
getNamesOfNestedUsersOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

getNestedChildGroupsOfGroup

public java.util.List<Group> getNestedChildGroupsOfGroup(java.lang.String groupName,
                                                         int startIndex,
                                                         int maxResults)
                                                  throws GroupNotFoundException,
                                                         ApplicationPermissionException,
                                                         InvalidAuthenticationException,
                                                         OperationFailedException
Description copied from interface: CrowdClient
Searches for groups who are nested members of a group.

Specified by:
getNestedChildGroupsOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of groups satisfying the search restriction.
Throws:
GroupNotFoundException - if the group could not be found
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 an unknown reason

getNamesOfNestedChildGroupsOfGroup

public java.util.List<java.lang.String> getNamesOfNestedChildGroupsOfGroup(java.lang.String groupName,
                                                                           int startIndex,
                                                                           int maxResults)
                                                                    throws GroupNotFoundException,
                                                                           ApplicationPermissionException,
                                                                           InvalidAuthenticationException,
                                                                           OperationFailedException
Description copied from interface: CrowdClient
Searches for groups who are nested members of a group, returning the group names.

Specified by:
getNamesOfNestedChildGroupsOfGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

getGroupsForNestedUser

public java.util.List<Group> getGroupsForNestedUser(java.lang.String userName,
                                                    int startIndex,
                                                    int maxResults)
                                             throws UserNotFoundException,
                                                    ApplicationPermissionException,
                                                    InvalidAuthenticationException,
                                                    OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a user is a nested member of.

Specified by:
getGroupsForNestedUser in interface CrowdClient
Parameters:
userName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of groups satisfying the search restriction.
Throws:
UserNotFoundException - if the user could not be found
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 an unknown reason

getNamesOfGroupsForNestedUser

public java.util.List<java.lang.String> getNamesOfGroupsForNestedUser(java.lang.String userName,
                                                                      int startIndex,
                                                                      int maxResults)
                                                               throws UserNotFoundException,
                                                                      ApplicationPermissionException,
                                                                      InvalidAuthenticationException,
                                                                      OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a user is a nested member of, returning the group names.

Specified by:
getNamesOfGroupsForNestedUser in interface CrowdClient
Parameters:
userName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

getParentGroupsForNestedGroup

public java.util.List<Group> getParentGroupsForNestedGroup(java.lang.String groupName,
                                                           int startIndex,
                                                           int maxResults)
                                                    throws GroupNotFoundException,
                                                           ApplicationPermissionException,
                                                           InvalidAuthenticationException,
                                                           OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a group is a nested member of.

Specified by:
getParentGroupsForNestedGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - maximum number of results returned from the search
Returns:
List of groups satisfying the search restriction.
Throws:
GroupNotFoundException - if the group could not be found
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 an unknown reason

getNamesOfParentGroupsForNestedGroup

public java.util.List<java.lang.String> getNamesOfParentGroupsForNestedGroup(java.lang.String groupName,
                                                                             int startIndex,
                                                                             int maxResults)
                                                                      throws GroupNotFoundException,
                                                                             ApplicationPermissionException,
                                                                             InvalidAuthenticationException,
                                                                             OperationFailedException
Description copied from interface: CrowdClient
Searches for groups that a group is a nested member of, returning the group names.

Specified by:
getNamesOfParentGroupsForNestedGroup in interface CrowdClient
Parameters:
groupName - restriction on the search
startIndex - starting index of the search results
maxResults - 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 found
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 an unknown reason

findUserFromSSOToken

public User findUserFromSSOToken(java.lang.String token)
                          throws InvalidTokenException,
                                 ApplicationPermissionException,
                                 InvalidAuthenticationException,
                                 OperationFailedException
Description copied from interface: CrowdClient
Returns the user from the specified user token.

Specified by:
findUserFromSSOToken in interface CrowdClient
Parameters:
token - user token used to find the authenticated user.
Returns:
User associated with the token.
Throws:
InvalidTokenException - if the provided token is not valid
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 an unknown reason

authenticateSSOUser

public java.lang.String authenticateSSOUser(UserAuthenticationContext userAuthenticationContext)
                                     throws ApplicationAccessDeniedException,
                                            ExpiredCredentialException,
                                            InactiveAccountException,
                                            ApplicationPermissionException,
                                            InvalidAuthenticationException,
                                            OperationFailedException
Description copied from interface: CrowdClient
Authenticates a Single-Sign-On (SSO) User.

Specified by:
authenticateSSOUser in interface CrowdClient
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 application
ExpiredCredentialException - if the user password has expired and the user is required to change their password
InactiveAccountException - if the user account is inactive
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 an unknown reason

authenticateSSOUserWithoutValidatingPassword

public java.lang.String authenticateSSOUserWithoutValidatingPassword(UserAuthenticationContext userAuthenticationContext)
                                                              throws ApplicationAccessDeniedException,
                                                                     InactiveAccountException,
                                                                     ApplicationPermissionException,
                                                                     InvalidAuthenticationException,
                                                                     OperationFailedException
Description copied from interface: CrowdClient
Authenticates a Single-Sign-On (SSO) User without validating password.

Specified by:
authenticateSSOUserWithoutValidatingPassword in interface CrowdClient
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 application
InactiveAccountException - if the user account has expired
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 an unknown reason

validateSSOAuthentication

public void validateSSOAuthentication(java.lang.String token,
                                      java.util.List<ValidationFactor> validationFactors)
                               throws InvalidTokenException,
                                      ApplicationPermissionException,
                                      InvalidAuthenticationException,
                                      OperationFailedException
Description copied from interface: CrowdClient
Validates the SSO authentication. Throws InvalidAuthenticationException if the SSO authentication is not valid.

Specified by:
validateSSOAuthentication in interface CrowdClient
Parameters:
token - Crowd SSO token
validationFactors - Details of where the user's come from. If presented, must match those presented during authentication.
Throws:
InvalidTokenException - if the supplied token is not valid
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 an unknown reason

invalidateSSOToken

public void invalidateSSOToken(java.lang.String token)
                        throws ApplicationPermissionException,
                               InvalidAuthenticationException,
                               OperationFailedException
Description copied from interface: CrowdClient
Invalidates a token. If the token does not exist, the token should still return silently.

Specified by:
invalidateSSOToken in interface CrowdClient
Parameters:
token - token to invalidate
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 an unknown reason

getCookieConfiguration

public CookieConfiguration getCookieConfiguration()
                                           throws ApplicationPermissionException,
                                                  InvalidAuthenticationException,
                                                  OperationFailedException
Description copied from interface: CrowdClient
Returns the cookie configuration.

Specified by:
getCookieConfiguration in interface CrowdClient
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 an unknown reason


Copyright © 2010 Atlassian. All Rights Reserved.