public class UsersResource extends AbstractResource
request, uriInfo| Constructor and Description | 
|---|
UsersResource(UsersController usersController)  | 
| Modifier and Type | Method and Description | 
|---|---|
javax.ws.rs.core.Response | 
addUser(UserEntity userEntity)
Creates a new user 
 | 
javax.ws.rs.core.Response | 
addUserToGroup(String userName,
              GroupEntity parentGroup)
Adds a user as a direct member of the group 
 | 
javax.ws.rs.core.Response | 
deleteUserPassword(String userName)
Deletes a user password. 
 | 
javax.ws.rs.core.Response | 
expireAllPasswords(boolean confirm)
Expires all passwords for all directories which are part of this application, regardless of
 group mapping. 
 | 
javax.ws.rs.core.Response | 
getAvatarForUser(String username,
                int size)
Returns the url of the user's avatar 
 | 
javax.ws.rs.core.Response | 
getDirectGroups(String userName,
               String groupName,
               int maxResults,
               int startIndex)
Returns the a list of groups the user is a direct member of. 
 | 
javax.ws.rs.core.Response | 
getNestedGroups(String userName,
               String groupName,
               int maxResults,
               int startIndex)
Retrieves the group that the user is a nested member of 
 | 
javax.ws.rs.core.Response | 
getUser(String userName,
       String key)
Retrieves the user details. 
 | 
javax.ws.rs.core.Response | 
getUserAttributes(String userName)
Retrieves a list of user attributes 
 | 
javax.ws.rs.core.Response | 
getUserByOpenid(URI openId)
Looks up a user by the v2 OpenID URL, and returns the user's details 
 | 
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 | 
renameUser(String userName,
          RenameEntity newUserName)
Renames a user. 
 | 
javax.ws.rs.core.Response | 
requestPasswordReset(String userName)
Sends the user a password reset link to the user's email address 
 | 
javax.ws.rs.core.Response | 
requestUsernamesReminder(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. 
 | 
getApplicationName, getBaseUri, setApplicationName, setRequest, setUriInfopublic UsersResource(UsersController usersController)
public javax.ws.rs.core.Response getUser(String userName, String key) throws UserNotFoundException
expand parameter can be used to include additional data in the response.
 This can currently be set to attributes, to include the user's attributes in the responseuserName - name of the userkey - the key of the user (only observed if userName is null).UserNotFoundException@ExperimentalApi public javax.ws.rs.core.Response getUserByOpenid(URI openId) throws UserNotFoundException
openId - the v2 OpenID URL for the userUserNotFoundExceptionpublic javax.ws.rs.core.Response addUser(UserEntity userEntity) throws InvalidUserException, InvalidCredentialException, UserNotFoundException, ApplicationPermissionException, OperationFailedException, UserAlreadyExistsException
public javax.ws.rs.core.Response updateUser(String userName, UserEntity userEntity) throws InvalidUserException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - name of the user to updateInvalidUserExceptionUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response removeUser(String userName) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - name of the user to removeUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response renameUser(String userName, RenameEntity newUserName) throws InvalidUserException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - name of the user to renameInvalidUserExceptionUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response getUserAttributes(String userName) throws UserNotFoundException
userName - name of the userUserNotFoundExceptionpublic javax.ws.rs.core.Response storeUserAttributes(String userName, MultiValuedAttributeEntityList attributes) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - name of the userUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response removeUserAttribute(String userName, String attributeName) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - name of the userattributeName - name of the attribute to deleteUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response updateUserPassword(String userName, PasswordEntity password) throws InvalidCredentialException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - the name of the user to update the password forInvalidCredentialExceptionUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response deleteUserPassword(String userName) throws InvalidCredentialException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - the name of the user to update the password forInvalidCredentialExceptionUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response requestPasswordReset(String userName) throws InvalidEmailAddressException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - name of the user to request a password resetInvalidEmailAddressExceptionUserNotFoundExceptionApplicationPermissionExceptionOperationFailedException@ExperimentalApi
public javax.ws.rs.core.Response expireAllPasswords(boolean confirm)
                                                              throws OperationFailedException
confirm - must be true to take the action. This is so all passwords cannot
                accidentally be expired.OperationFailedExceptionpublic javax.ws.rs.core.Response requestUsernamesReminder(String email) throws InvalidEmailAddressException
email - email address of the userInvalidEmailAddressExceptionpublic javax.ws.rs.core.Response getDirectGroups(String userName, String groupName, int maxResults, int startIndex) throws MembershipNotFoundException, UserNotFoundException
userName - name of the usergroupName - 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 returnstartIndex - start index of the resultMembershipNotFoundExceptionUserNotFoundExceptionpublic javax.ws.rs.core.Response addUserToGroup(String userName, GroupEntity parentGroup) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException, MembershipAlreadyExistsException
userName - name of the userparentGroup - parent group entityUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionMembershipAlreadyExistsExceptionpublic javax.ws.rs.core.Response removeUserFromGroup(String userName, String groupName) throws GroupNotFoundException, MembershipNotFoundException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName - name of the usergroupName - name of the groupGroupNotFoundExceptionMembershipNotFoundExceptionUserNotFoundExceptionApplicationPermissionExceptionOperationFailedExceptionpublic javax.ws.rs.core.Response getNestedGroups(String userName, String groupName, int maxResults, int startIndex) throws MembershipNotFoundException, UserNotFoundException
userName - name of the usergroupName - 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 returnstartIndex - start index of the resultMembershipNotFoundExceptionUserNotFoundException@ExperimentalApi public javax.ws.rs.core.Response getAvatarForUser(String username, int size) throws UserNotFoundException, DirectoryNotFoundException, OperationFailedException
username - the name of the usersize - the requested avatar size in pixelsUserNotFoundExceptionDirectoryNotFoundExceptionOperationFailedExceptionCopyright © 2019 Atlassian. All rights reserved.