com.atlassian.crowd.plugin.rest.service.resource
Class UsersResource

java.lang.Object
  extended by com.atlassian.crowd.plugin.rest.service.resource.AbstractResource
      extended by com.atlassian.crowd.plugin.rest.service.resource.UsersResource

public class UsersResource
extends AbstractResource


Field Summary
 
Fields inherited from class com.atlassian.crowd.plugin.rest.service.resource.AbstractResource
DEFAULT_SEARCH_RESULT_SIZE, MAX_RESULTS_PARAM, request, START_INDEX_PARAM, uriInfo
 
Constructor Summary
UsersResource(UsersController usersController)
           
 
Method Summary
 javax.ws.rs.core.Response addUser(UserEntity userEntity)
          Adds a new user.
 javax.ws.rs.core.Response addUserToGroup(String userName, GroupEntity parentGroup)
          Adds a user to a group.
 javax.ws.rs.core.Response getDirectGroups(String userName, String groupName, int maxResults, int startIndex)
          Returns the direct group(s) of the user.
 javax.ws.rs.core.Response getNestedGroups(String userName, String groupName, int maxResults, int startIndex)
          Returns the nested group(s) of the user.
 javax.ws.rs.core.Response getUser(String userName)
          Retrieves the user.
 javax.ws.rs.core.Response getUserAttributes(String userName)
          Retrieves the user attributes.
 javax.ws.rs.core.Response removeUser(String userName)
          Removes a user.
 javax.ws.rs.core.Response removeUserAttribute(String userName, String attributeName)
          Deletes a user attribute.
 javax.ws.rs.core.Response removeUserFromGroup(String userName, String groupName)
          Removes a user from a group.
 javax.ws.rs.core.Response requestPasswordReset(String userName)
          Requests a password reset.
 javax.ws.rs.core.Response requestUsernames(String email)
          Requests an email to be sent containing usernames associated with the given email address.
 javax.ws.rs.core.Response storeUserAttributes(String userName, MultiValuedAttributeEntityList attributes)
          Stores the user attributes.
 javax.ws.rs.core.Response updateUser(String userName, UserEntity userEntity)
          Updates a user.
 javax.ws.rs.core.Response updateUserPassword(String userName, PasswordEntity password)
          Updates a user password.
 
Methods inherited from class com.atlassian.crowd.plugin.rest.service.resource.AbstractResource
getApplicationName, getBaseUri
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsersResource

public UsersResource(UsersController usersController)
Method Detail

getUser

public javax.ws.rs.core.Response getUser(String userName)
                                  throws UserNotFoundException
Retrieves the user.

Parameters:
userName - name of the user.
Throws:
UserNotFoundException

addUser

public javax.ws.rs.core.Response addUser(UserEntity userEntity)
                                  throws InvalidUserException,
                                         InvalidCredentialException,
                                         UserNotFoundException,
                                         ApplicationPermissionException,
                                         OperationFailedException
Adds a new user.

Parameters:
userEntity - the user to create
Throws:
InvalidUserException
InvalidCredentialException
UserNotFoundException
ApplicationPermissionException
OperationFailedException

updateUser

public javax.ws.rs.core.Response updateUser(String userName,
                                            UserEntity userEntity)
                                     throws InvalidUserException,
                                            UserNotFoundException,
                                            ApplicationPermissionException,
                                            OperationFailedException
Updates a user.

Parameters:
userName - name of the user to update
userEntity - the user to create
Throws:
InvalidUserException
UserNotFoundException
ApplicationPermissionException
OperationFailedException

removeUser

public javax.ws.rs.core.Response removeUser(String userName)
                                     throws UserNotFoundException,
                                            ApplicationPermissionException,
                                            OperationFailedException
Removes a user.

Parameters:
userName - name of the user to delete
Throws:
UserNotFoundException
ApplicationPermissionException
OperationFailedException

getUserAttributes

public javax.ws.rs.core.Response getUserAttributes(String userName)
                                            throws UserNotFoundException
Retrieves the user attributes.

Parameters:
userName - name of the user.
Throws:
UserNotFoundException

storeUserAttributes

public javax.ws.rs.core.Response storeUserAttributes(String userName,
                                                     MultiValuedAttributeEntityList attributes)
                                              throws UserNotFoundException,
                                                     ApplicationPermissionException,
                                                     OperationFailedException
Stores the user attributes.

Parameters:
userName - name of the user
attributes - new attributes of the user
Throws:
UserNotFoundException
ApplicationPermissionException
OperationFailedException

removeUserAttribute

public javax.ws.rs.core.Response removeUserAttribute(String userName,
                                                     String attributeName)
                                              throws UserNotFoundException,
                                                     ApplicationPermissionException,
                                                     OperationFailedException
Deletes a user attribute.

Parameters:
userName - name of the user
attributeName - name of the attribute to delete
Throws:
UserNotFoundException
ApplicationPermissionException
OperationFailedException

updateUserPassword

public javax.ws.rs.core.Response updateUserPassword(String userName,
                                                    PasswordEntity password)
                                             throws InvalidCredentialException,
                                                    UserNotFoundException,
                                                    ApplicationPermissionException,
                                                    OperationFailedException
Updates a user password.

Parameters:
userName - the name of the user to update the password for
password - the password to set against the user
Throws:
InvalidCredentialException
UserNotFoundException
ApplicationPermissionException
OperationFailedException

requestPasswordReset

public javax.ws.rs.core.Response requestPasswordReset(String userName)
                                               throws InvalidEmailAddressException,
                                                      UserNotFoundException,
                                                      ApplicationPermissionException,
                                                      OperationFailedException
Requests a password reset.

Parameters:
userName - name of the user to request a password reset
Throws:
InvalidEmailAddressException
UserNotFoundException
ApplicationPermissionException
OperationFailedException

requestUsernames

public javax.ws.rs.core.Response requestUsernames(String email)
                                           throws InvalidEmailAddressException,
                                                  UserNotFoundException,
                                                  ApplicationPermissionException,
                                                  OperationFailedException
Requests an email to be sent containing usernames associated with the given email address.

Parameters:
email - email address of the user
Throws:
InvalidEmailAddressException
UserNotFoundException
ApplicationPermissionException
OperationFailedException

getDirectGroups

public javax.ws.rs.core.Response getDirectGroups(String userName,
                                                 String groupName,
                                                 int maxResults,
                                                 int startIndex)
                                          throws MembershipNotFoundException
Returns the direct group(s) of the user.

Parameters:
userName - name of the user
groupName - name of the group (optional). If null, then all the groups that the user is a direct member of, are returned.
maxResults - maximum number of results to return
startIndex - start index of the result
Throws:
MembershipNotFoundException

addUserToGroup

public javax.ws.rs.core.Response addUserToGroup(String userName,
                                                GroupEntity parentGroup)
                                         throws UserNotFoundException,
                                                ApplicationPermissionException,
                                                OperationFailedException
Adds a user to a group.

Parameters:
userName - name of the user
parentGroup - parent group entity
Throws:
UserNotFoundException
ApplicationPermissionException
OperationFailedException

removeUserFromGroup

public javax.ws.rs.core.Response removeUserFromGroup(String userName,
                                                     String groupName)
                                              throws GroupNotFoundException,
                                                     MembershipNotFoundException,
                                                     UserNotFoundException,
                                                     ApplicationPermissionException,
                                                     OperationFailedException
Removes a user from a group.

Parameters:
userName - name of the user
groupName - name of the group
Throws:
GroupNotFoundException
MembershipNotFoundException
UserNotFoundException
ApplicationPermissionException
OperationFailedException

getNestedGroups

public javax.ws.rs.core.Response getNestedGroups(String userName,
                                                 String groupName,
                                                 int maxResults,
                                                 int startIndex)
                                          throws MembershipNotFoundException
Returns the nested group(s) of the user.

Parameters:
userName - name of the user
groupName - name of the group (optional). If null, then all the groups that the user is a nested member of, are returned.
maxResults - maximum number of results to return
startIndex - start index of the result
Throws:
MembershipNotFoundException


Copyright © 2012 Atlassian. All Rights Reserved.