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, setUriInfo
public 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 userUserNotFoundException
public 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 updateInvalidUserException
UserNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response removeUser(String userName) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName
- name of the user to removeUserNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response renameUser(String userName, RenameEntity newUserName) throws InvalidUserException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName
- name of the user to renameInvalidUserException
UserNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response getUserAttributes(String userName) throws UserNotFoundException
userName
- name of the userUserNotFoundException
public javax.ws.rs.core.Response storeUserAttributes(String userName, MultiValuedAttributeEntityList attributes) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName
- name of the userUserNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response removeUserAttribute(String userName, String attributeName) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName
- name of the userattributeName
- name of the attribute to deleteUserNotFoundException
ApplicationPermissionException
OperationFailedException
public 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 forInvalidCredentialException
UserNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response deleteUserPassword(String userName) throws InvalidCredentialException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName
- the name of the user to update the password forInvalidCredentialException
UserNotFoundException
ApplicationPermissionException
OperationFailedException
public javax.ws.rs.core.Response requestPasswordReset(String userName) throws InvalidEmailAddressException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName
- name of the user to request a password resetInvalidEmailAddressException
UserNotFoundException
ApplicationPermissionException
OperationFailedException
@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.OperationFailedException
public javax.ws.rs.core.Response requestUsernamesReminder(String email) throws InvalidEmailAddressException
email
- email address of the userInvalidEmailAddressException
public 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 resultMembershipNotFoundException
UserNotFoundException
public javax.ws.rs.core.Response addUserToGroup(String userName, GroupEntity parentGroup) throws UserNotFoundException, ApplicationPermissionException, OperationFailedException, MembershipAlreadyExistsException
userName
- name of the userparentGroup
- parent group entityUserNotFoundException
ApplicationPermissionException
OperationFailedException
MembershipAlreadyExistsException
public javax.ws.rs.core.Response removeUserFromGroup(String userName, String groupName) throws GroupNotFoundException, MembershipNotFoundException, UserNotFoundException, ApplicationPermissionException, OperationFailedException
userName
- name of the usergroupName
- name of the groupGroupNotFoundException
MembershipNotFoundException
UserNotFoundException
ApplicationPermissionException
OperationFailedException
public 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 resultMembershipNotFoundException
UserNotFoundException
@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 pixelsUserNotFoundException
DirectoryNotFoundException
OperationFailedException
Copyright © 2020 Atlassian. All rights reserved.
View cookie preferences