|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.crowd.service.cache.CachingUserManager
public class CachingUserManager
Constructor Summary | |
---|---|
CachingUserManager(SecurityServerClient securityServerClient,
BasicCache basicCache)
|
Method Summary | |
---|---|
void |
addAllUsers(java.util.Collection<SOAPPrincipalWithCredential> users)
Adds all users to Crowd. |
SOAPPrincipal |
addUser(SOAPPrincipal user,
PasswordCredential credential)
Adds a user to Crowd. |
java.util.List |
getAllUserNames()
This optimises the background getAllUserNames() call. |
SOAPPrincipal |
getUser(java.lang.String userName)
Given a userName , fetches the user's details, either from cache or from the Crowd server. |
SOAPPrincipal |
getUserFromToken(java.lang.String token)
Note: the lookup is not currently cached - it will always hit the server. |
SOAPPrincipal |
getUserWithAttributes(java.lang.String userName)
Given a userName , fetches the user's details and their associated attributes, either from cache or from the Crowd server. |
boolean |
isUser(java.lang.String userName)
With JIRA we're guaranteed that if there are any names in the user list, all the names are in the user list. |
void |
removeUser(java.lang.String userName)
Removes a user from Crowd. |
java.util.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(java.lang.String userName,
PasswordCredential credential)
Changes the password for the user specified by userName . |
void |
updateUser(SOAPPrincipal user)
Updates a user's details in Crowd. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CachingUserManager(SecurityServerClient securityServerClient, BasicCache basicCache)
Method Detail |
---|
public SOAPPrincipal getUser(java.lang.String userName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException
UserManager
userName
, fetches the user's details, either from cache or from the Crowd server.
getUser
in interface UserManager
userName
- The user's identifer
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.public SOAPPrincipal getUserWithAttributes(java.lang.String userName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException, ObjectNotFoundException
UserManager
userName
, fetches the user's details and their associated attributes, either from cache or from the Crowd server.
getUserWithAttributes
in interface UserManager
userName
- The user's identifer
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.
ObjectNotFoundException
public SOAPPrincipal getUserFromToken(java.lang.String token) throws java.rmi.RemoteException, InvalidAuthorizationTokenException, InvalidTokenException
getUserFromToken
in interface UserManager
token
-
java.rmi.RemoteException
InvalidAuthorizationTokenException
com.atlassian.crowd.embedded.api.UserNotFoundException
InvalidTokenException
- The token presented was not a valid Crowd token.public java.util.List searchUsers(SearchRestriction[] restrictions) throws java.rmi.RemoteException, InvalidAuthorizationTokenException
UserManager
restrictions
and returns a list
of users that match.
searchUsers
in interface UserManager
List
of SOAPPrincipal
s that match the criteria.
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.public SOAPPrincipal addUser(SOAPPrincipal user, PasswordCredential credential) throws java.rmi.RemoteException, ApplicationPermissionException, InvalidCredentialException, InvalidUserException, InvalidAuthorizationTokenException
UserManager
addUser
in interface UserManager
user
- The user to add to Crowdcredential
- The credential (eg. password) for the user. May be null.
SOAPPrincipal
, as returned by the Crowd server.
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
ApplicationPermissionException
- The application, not the user, does not have rights to add users.
InvalidCredentialException
- The credentials were malformed or did not meet directory complexity
requirements.
InvalidUserException
- The user was malformed or already exists.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.public void addAllUsers(java.util.Collection<SOAPPrincipalWithCredential> users) throws InvalidAuthorizationTokenException, BulkAddFailedException, java.rmi.RemoteException, ApplicationPermissionException
UserManager
addAllUsers
in interface UserManager
users
- The users to add to Crowd
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.
BulkAddFailedException
- Thrown when it failed to create a user in of the directories.
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
ApplicationPermissionException
- The application, not the user, does not have rights to add users.public void updateUser(SOAPPrincipal user) throws java.rmi.RemoteException, ApplicationPermissionException, InvalidAuthorizationTokenException
UserManager
updateUser
in interface UserManager
user
- The user to update
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
ApplicationPermissionException
- This application does not have the rights to update the user. Sorry.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.public void updatePassword(java.lang.String userName, PasswordCredential credential) throws java.rmi.RemoteException, InvalidAuthorizationTokenException, InvalidCredentialException, ApplicationPermissionException
UserManager
userName
.
updatePassword
in interface UserManager
userName
- The identifier of the usercredential
- The new credentials for the user.
java.rmi.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.
ApplicationPermissionException
- This application does not have the rights to update the user's password.
Sorry.public void removeUser(java.lang.String userName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException, ApplicationPermissionException
UserManager
removeUser
in interface UserManager
userName
- The name of the user to remove.
java.rmi.RemoteException
- A communication error occurred - the Crowd server may not be available.
InvalidAuthorizationTokenException
- The application (not the user) was not authenticated correctly.
ApplicationPermissionException
- This application is not allowed to remove this user.public java.util.List getAllUserNames() throws java.rmi.RemoteException, InvalidAuthorizationTokenException
getAllUserNames
in interface UserManager
java.rmi.RemoteException
InvalidAuthorizationTokenException
public boolean isUser(java.lang.String userName) throws java.rmi.RemoteException, InvalidAuthorizationTokenException
isUser
in interface UserManager
userName
-
java.rmi.RemoteException
InvalidAuthorizationTokenException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |