com.atlassian.crowd.service
Interface UserManager

All Known Implementing Classes:
CachingUserManager

public interface UserManager

Methods related to operations on users, but not on their group or role memberships.


Method Summary
 void addAllUsers(Collection<SOAPPrincipalWithCredential> users)
          Adds all users to Crowd.
 SOAPPrincipal addUser(SOAPPrincipal user, PasswordCredential credential)
          Adds a user to Crowd.
 List getAllUserNames()
          Deprecated. Since 1.4.
 SOAPPrincipal getUser(String userName)
          Given a userName, fetches the user's details, either from cache or from the Crowd server.
 SOAPPrincipal getUserFromToken(String token)
          Given an authentication token, retrieves the user associated with it.
 SOAPPrincipal getUserWithAttributes(String userName)
          Given a userName, fetches the user's details and their associated attributes, either from cache or from the Crowd server.
 boolean isUser(String userName)
          Returns true if userName represents a valid user.
 void removeUser(String userName)
          Removes a user from Crowd.
 List searchUsers(SearchRestriction[] restrictions)
          Searches the list of all available users based on the passed-in restrictions and returns a list of users that match.
 void updatePassword(String userName, PasswordCredential credential)
          Changes the password for the user specified by userName.
 void updateUser(SOAPPrincipal user)
          Updates a user's details in Crowd.
 

Method Detail

isUser

boolean isUser(String userName)
               throws RemoteException,
                      InvalidAuthorizationTokenException,
                      InvalidAuthenticationException
Returns true if userName represents a valid user. Will return true if the user is valid but inactive.

Parameters:
userName - name of the user
Returns:
true if the user is valid, false otherwise.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidAuthenticationException - if the application name/password combination is invalid

getUser

SOAPPrincipal getUser(String userName)
                      throws RemoteException,
                             InvalidAuthorizationTokenException,
                             UserNotFoundException,
                             InvalidAuthenticationException
Given a userName, fetches the user's details, either from cache or from the Crowd server.

Parameters:
userName - The user's identifier
Returns:
An object representing the user
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
UserNotFoundException - Could not find the user.
InvalidAuthenticationException - if the application name/password combination is invalid

getUserWithAttributes

SOAPPrincipal getUserWithAttributes(String userName)
                                    throws RemoteException,
                                           InvalidAuthorizationTokenException,
                                           UserNotFoundException,
                                           InvalidAuthenticationException
Given a userName, fetches the user's details and their associated attributes, either from cache or from the Crowd server.

Parameters:
userName - The user's identifier
Returns:
An object representing the user and their attributes
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
UserNotFoundException - Could not find the user.
InvalidAuthenticationException - if the application name/password combination is invalid

getUserFromToken

SOAPPrincipal getUserFromToken(String token)
                               throws RemoteException,
                                      InvalidAuthorizationTokenException,
                                      InvalidTokenException,
                                      InvalidAuthenticationException
Given an authentication token, retrieves the user associated with it.

Parameters:
token - The token presented by the client browser to the webserver.
Returns:
An object representing the user
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidTokenException - The token presented was not a valid Crowd token.
InvalidAuthenticationException - if the application name/password combination is invalid

searchUsers

List searchUsers(SearchRestriction[] restrictions)
                 throws RemoteException,
                        InvalidAuthorizationTokenException,
                        InvalidAuthenticationException
Searches the list of all available users based on the passed-in restrictions and returns a list of users that match.

Parameters:
restrictions - search restrictions
Returns:
A List of SOAPPrincipals that match the criteria.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidAuthenticationException - if the application name/password combination is invalid

addUser

SOAPPrincipal addUser(SOAPPrincipal user,
                      PasswordCredential credential)
                      throws RemoteException,
                             ApplicationPermissionException,
                             InvalidCredentialException,
                             InvalidUserException,
                             InvalidAuthorizationTokenException,
                             InvalidAuthenticationException
Adds a user to Crowd.

Parameters:
user - The user to add to Crowd
credential - The credential (eg. password) for the user. May be null.
Returns:
The SOAPPrincipal, as returned by the Crowd server.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
ApplicationPermissionException - The application does not have rights to add users.
InvalidUserException - The user was malformed or already exists.
InvalidCredentialException - The credentials were malformed or did not meet directory complexity requirements.
InvalidAuthenticationException - if the application name/password combination is invalid

addAllUsers

void addAllUsers(Collection<SOAPPrincipalWithCredential> users)
                 throws InvalidAuthorizationTokenException,
                        RemoteException,
                        ApplicationPermissionException,
                        BulkAddFailedException,
                        InvalidAuthenticationException
Adds all users to Crowd. N.B.: After adding the users the cache gets flushed.

Parameters:
users - The users to add to Crowd
Throws:
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
RemoteException - A communication error occurred - the Crowd server may not be available.
ApplicationPermissionException - The application does not have rights to add users.
BulkAddFailedException - Thrown if it failed to create a user in of the directories.
InvalidAuthenticationException - if the application name/password combination is invalid

updateUser

void updateUser(SOAPPrincipal user)
                throws RemoteException,
                       ApplicationPermissionException,
                       InvalidAuthorizationTokenException,
                       UserNotFoundException,
                       InvalidAuthenticationException
Updates a user's details in Crowd.

Parameters:
user - The user to update
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
UserNotFoundException - The user to update could not be found.
ApplicationPermissionException - This application does not have the rights to update the user.
InvalidAuthenticationException - if the application name/password combination is invalid

updatePassword

void updatePassword(String userName,
                    PasswordCredential credential)
                    throws RemoteException,
                           InvalidAuthorizationTokenException,
                           InvalidCredentialException,
                           ApplicationPermissionException,
                           UserNotFoundException,
                           InvalidAuthenticationException
Changes the password for the user specified by userName.

Parameters:
userName - The identifier of the user
credential - The new credentials for the user.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidCredentialException - The credentials were malformed or did not meet directory complexity requirements.
UserNotFoundException - The user could not be found in any directory mapped to this application.
ApplicationPermissionException - This application does not have the rights to update the user's password.
InvalidAuthenticationException - if the application name/password combination is invalid

removeUser

void removeUser(String userName)
                throws RemoteException,
                       InvalidAuthorizationTokenException,
                       UserNotFoundException,
                       ApplicationPermissionException,
                       InvalidAuthenticationException
Removes a user from Crowd.

Parameters:
userName - The name of the user to remove.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
UserNotFoundException - The user to remove could not be found.
ApplicationPermissionException - This application is not allowed to remove this user.
InvalidAuthenticationException - if the application name/password combination is invalid

getAllUserNames

List getAllUserNames()
                     throws RemoteException,
                            InvalidAuthorizationTokenException,
                            InvalidAuthenticationException
Deprecated. Since 1.4.

Returns a list of all available users. We strongly recommend against use of this API; it will prevent your application from scaling.

If you're implementing a user-picker or similar, use searchUsers() instead. Presenting a drop-down list of 10m users simply won't work.

Returns:
A List of Strings that list all the users visible to this application.
Throws:
RemoteException - A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException - The application (not the user) was not authenticated correctly.
InvalidAuthenticationException - if the application name/password combination is invalid


Copyright © 2013 Atlassian. All Rights Reserved.