|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.plugin.rest.service.controller.AbstractResourceController com.atlassian.crowd.plugin.rest.service.controller.UsersController
public class UsersController
Controller responsible for user management.
Field Summary |
---|
Fields inherited from class com.atlassian.crowd.plugin.rest.service.controller.AbstractResourceController |
---|
applicationManager, applicationService |
Constructor Summary | |
---|---|
UsersController(ApplicationService applicationService,
ApplicationManager applicationManager,
ForgottenLoginManager forgottenLoginManager)
|
Method Summary | |
---|---|
String |
addUser(String applicationName,
UserEntity userEntity)
Adds a new user. |
void |
addUserToGroup(String applicationName,
String userName,
String groupName)
Adds a user to a group. |
UserEntity |
findUserByName(String applicationName,
String name,
com.atlassian.plugins.rest.common.Link userLink,
boolean expandAttributes)
Returns a UserEntity specified by the name. |
GroupEntity |
getDirectGroup(String applicationName,
String userName,
String groupName,
URI baseUri)
Returns the specified group that the user is a direct member of. |
GroupEntityList |
getDirectGroups(String applicationName,
String userName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Returns the groups that the user is a direct member of. |
GroupEntity |
getNestedGroup(String applicationName,
String userName,
String groupName,
URI baseUri)
Returns the specified group that the user is a nested member of. |
GroupEntityList |
getNestedGroups(String applicationName,
String userName,
boolean expandGroups,
int maxResults,
int startIndex,
URI baseUri)
Returns the groups that the user is a nested member of. |
void |
removeUser(String applicationName,
String username)
Removes the user. |
void |
removeUserAttribute(String applicationName,
String username,
String attributeName)
Removes the user attribute. |
void |
removeUserFromGroup(String applicationName,
String userName,
String groupName)
Removes a user from a group. |
void |
requestPasswordReset(String applicationName,
String username)
Requests a password reset. |
boolean |
requestUsernames(String applicationName,
String email)
Requests an email to be sent containing usernames associated with the given email address. |
void |
storeUserAttributes(String applicationName,
String username,
MultiValuedAttributeEntityList attributes)
Stores (add/replace) the user attributes. |
String |
updateUser(String applicationName,
UserEntity userEntity)
Updates a user. |
void |
updateUserPassword(String applicationName,
String username,
String password)
Updates a user's password. |
Methods inherited from class com.atlassian.crowd.plugin.rest.service.controller.AbstractResourceController |
---|
getApplication |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UsersController(ApplicationService applicationService, ApplicationManager applicationManager, ForgottenLoginManager forgottenLoginManager)
Method Detail |
---|
public UserEntity findUserByName(String applicationName, String name, com.atlassian.plugins.rest.common.Link userLink, boolean expandAttributes) throws UserNotFoundException
applicationName
- name of the applicationname
- name of the user to retrieveuserLink
- link to the user resourceexpandAttributes
- set to true if the attributes field should be expanded
UserNotFoundException
- if the user could not be foundpublic String addUser(String applicationName, UserEntity userEntity) throws ApplicationPermissionException, InvalidUserException, InvalidCredentialException, OperationFailedException
applicationName
- name of the applicationuserEntity
- new user to add
ApplicationPermissionException
- if none of the application's underlying directories are allowed to perform this operation
OperationFailedException
- if the operation failed for any other reason
InvalidCredentialException
- if the password is not valid
InvalidUserException
- if the user is not validpublic String updateUser(String applicationName, UserEntity userEntity) throws ApplicationPermissionException, InvalidUserException, UserNotFoundException, OperationFailedException
applicationName
- name of the applicationuserEntity
- updated user information
ApplicationPermissionException
- if none of the application's underlying directories are allowed to perform this operation
InvalidUserException
- if the user template does not have the required properties populated.
UserNotFoundException
- if the user was not found
OperationFailedException
- if the operation failed for any other reasonpublic void storeUserAttributes(String applicationName, String username, MultiValuedAttributeEntityList attributes) throws ApplicationPermissionException, UserNotFoundException, OperationFailedException
applicationName
- name of the applicationusername
- name of the userattributes
- attributes of the user
ApplicationPermissionException
- if none of the application's underlying directories are allowed to perform this operation
OperationFailedException
- if the operation failed for any other reason
UserNotFoundException
- if the user could not be foundpublic void removeUserAttribute(String applicationName, String username, String attributeName) throws ApplicationPermissionException, UserNotFoundException, OperationFailedException
applicationName
- name of the applicationusername
- name of the userattributeName
- name of attribute to remove
ApplicationPermissionException
- if none of the application's underlying directories have permission to perform the operation
OperationFailedException
- if the operation failed for any other reason
UserNotFoundException
- if the user could not be foundpublic void requestPasswordReset(String applicationName, String username) throws InvalidEmailAddressException, ApplicationPermissionException, ApplicationNotFoundException, UserNotFoundException
applicationName
- name of the applicationusername
- name of the user
UserNotFoundException
- if the user could not be found
InvalidEmailAddressException
- if the user does not have a valid email to send the reset password link to
ApplicationPermissionException
- if none of the application's underlying directories can update the user's password
ApplicationNotFoundException
- if the application could not be foundpublic boolean requestUsernames(String applicationName, String email) throws InvalidEmailAddressException, ApplicationNotFoundException
applicationName
- name of the applicationemail
- email address of the user
InvalidEmailAddressException
- if the email
is not valid
ApplicationNotFoundException
- if the application could not be foundpublic void removeUser(String applicationName, String username) throws ApplicationPermissionException, UserNotFoundException, OperationFailedException
applicationName
- name of the applicationusername
- name of the user
ApplicationPermissionException
- if none of the application's underlying directories can update the user's password
OperationFailedException
- if the operation failed for any other reason
UserNotFoundException
- if the user could not be foundpublic void updateUserPassword(String applicationName, String username, String password) throws ApplicationPermissionException, UserNotFoundException, InvalidCredentialException, OperationFailedException
applicationName
- name of the applicationusername
- name of the userpassword
- new password
ApplicationPermissionException
- if none of the application's underlying directories are allowed to perform this operation
UserNotFoundException
- if the user was not found
OperationFailedException
- if the operation failed for any other reason
InvalidCredentialException
- if the new password is not validpublic GroupEntityList getDirectGroups(String applicationName, String userName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
applicationName
- name of the applicationuserName
- name of the userexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URI of the REST service
public GroupEntity getDirectGroup(String applicationName, String userName, String groupName, URI baseUri) throws MembershipNotFoundException
applicationName
- name of the applicationuserName
- name of the usergroupName
- name of the group the user is a member ofbaseUri
- base URI of the REST service
MembershipNotFoundException
- if the membership was not foundpublic void addUserToGroup(String applicationName, String userName, String groupName) throws ApplicationPermissionException, UserNotFoundException, GroupNotFoundException, OperationFailedException
applicationName
- name of the applicationuserName
- name of the usergroupName
- name of the group
ApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.
UserNotFoundException
- if the user could not be found
GroupNotFoundException
- if the group could not be found
OperationFailedException
- if the operation failed for any other reasonpublic void removeUserFromGroup(String applicationName, String userName, String groupName) throws ApplicationPermissionException, MembershipNotFoundException, UserNotFoundException, GroupNotFoundException, OperationFailedException
applicationName
- name of the applicationuserName
- name of the usergroupName
- name of the group
ApplicationPermissionException
- if none of the application's associated directories are allowed to perform operations of type OperationType.UPDATE_GROUP
.
GroupNotFoundException
- if the group could not be found
MembershipNotFoundException
- if the membership does not exist
UserNotFoundException
- if the user could not be found
OperationFailedException
- if the operation failed for any other reasonpublic GroupEntityList getNestedGroups(String applicationName, String userName, boolean expandGroups, int maxResults, int startIndex, URI baseUri)
applicationName
- name of the applicationuserName
- name of the userexpandGroups
- should groups be expandedmaxResults
- maximum number of results returned. If -1, then all the results are returned.startIndex
- starting index of the resultsbaseUri
- base URI of the REST service
public GroupEntity getNestedGroup(String applicationName, String userName, String groupName, URI baseUri) throws MembershipNotFoundException
applicationName
- name of the applicationuserName
- name of the usergroupName
- name of the group the user is a member ofbaseUri
- base URI of the REST service
MembershipNotFoundException
- if the membership was not found
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |