@Component public class UserManagerImpl extends ManagerHelperImpl<User> implements UserManager
UserManager.AuthType, UserManager.UpdateField, UserManager.UserJoinStatus| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
classType |
HIDE_PASSWORD, INVALID_CREDENTIALS_MSG| Constructor and Description |
|---|
UserManagerImpl() |
| Modifier and Type | Method and Description |
|---|---|
AuthenticationData |
authenticate(java.lang.String loginName,
java.lang.String password,
boolean rememberMe)
Authenticates the provided credentials in the context of the current partner reference
|
void |
changePassword(XInfo xinfo,
java.lang.String newPassword) |
User |
findByLogin(java.lang.String loginName)
Returns the User with the provided login name in the context of the current partner reference.
|
User |
findByLogin(java.lang.String partnerRef,
java.lang.String loginName)
Returns the User with the provided login name in the context of a partner reference.
|
java.util.List<java.lang.String> |
findJoinedApplications(java.lang.String loginName)
Returns the list of partner references a user has joined.
|
Pair<UserManager.UserJoinStatus,User> |
getJoinedStatus(java.lang.String loginName)
Returns whether a user exists and if so whether the user belongs to the current
partner reference
|
Pair<UserManager.UserJoinStatus,User> |
getJoinedStatus(java.lang.String partnerRef,
java.lang.String loginName) |
User |
getUser(java.lang.String accessToken)
Returns the User associated with an access token.
|
User |
getUser(XInfo xinfo)
Returns the User represented by the specified external reference information in the
context of the current partner reference.
|
User |
joinApplication()
Connects the currently authenticated user with the running partner application or service.
|
User |
joinApplication(java.lang.String loginName,
java.lang.String password)
Connects a user with the running partner application or service.
|
User |
joinApplication(java.lang.String partnerRef,
java.lang.String loginName,
java.lang.String password)
Connects a user with the specified partner application or service.
|
User |
leaveApplication()
Disconnects the currently authenticated user with the running partner application or service.
|
User |
leaveApplication(java.lang.String loginName,
java.lang.String password) |
User |
leaveApplication(java.lang.String partnerRef,
java.lang.String loginName,
java.lang.String password) |
void |
logout() |
User |
persist(UserBuilder ub)
Persists a
User object, creating an external reference linking the user to the current partner reference. |
User |
persist(UserBuilder ub,
java.util.UUID reservation)
Persists a
User object, creating an external reference linking the user to the current partner reference. |
java.util.UUID |
reserveLoginName(java.lang.String loginName)
Returns whether a login name is already in use.
|
void |
update(XInfo xInfo,
java.util.List<Pair<UserManager.UpdateField,java.lang.Object>> values) |
createExternalReferenceForpublic java.util.UUID reserveLoginName(java.lang.String loginName)
throws AlreadyExistsException
UserManager
If the name is available, reserves the name for ReservedNameList.RESERVE_SECONDS_DEFAULT
seconds.
reserveLoginName in interface UserManagerloginName - Login name to check.AlreadyExistsException - loginName is already in use or reserved.public AuthenticationData authenticate(java.lang.String loginName, java.lang.String password, boolean rememberMe) throws AuthenticationException, java.lang.IllegalArgumentException, NotFoundException
UserManagerauthenticate in interface UserManagerloginName - User's login namepassword - User's passwordrememberMe - true when applicable, create a cookie for this user; otherwise falseAuthenticationExceptionjava.lang.IllegalArgumentExceptionNotFoundExceptionpublic Pair<UserManager.UserJoinStatus,User> getJoinedStatus(java.lang.String loginName)
UserManagergetJoinedStatus in interface UserManagerloginName - User's login namepublic Pair<UserManager.UserJoinStatus,User> getJoinedStatus(java.lang.String partnerRef, java.lang.String loginName)
getJoinedStatus in interface UserManagerpublic User joinApplication() throws NotFoundException, AuthenticationException
UserManagerjoinApplication in interface UserManagerNotFoundExceptionAuthenticationExceptionpublic User leaveApplication() throws NotFoundException, AuthenticationException
UserManagerleaveApplication in interface UserManagerNotFoundExceptionAuthenticationExceptionpublic User joinApplication(java.lang.String loginName, java.lang.String password) throws NotFoundException, AuthenticationException, AlreadyExistsException, java.lang.IllegalArgumentException
UserManagerjoinApplication in interface UserManagerloginName - User's login namepassword - User's passwordNotFoundExceptionAuthenticationExceptionAlreadyExistsExceptionjava.lang.IllegalArgumentExceptionpublic User leaveApplication(java.lang.String loginName, java.lang.String password) throws NotFoundException, AuthenticationException, AlreadyExistsException, java.lang.IllegalArgumentException
leaveApplication in interface UserManagerNotFoundExceptionAuthenticationExceptionAlreadyExistsExceptionjava.lang.IllegalArgumentExceptionpublic User joinApplication(java.lang.String partnerRef, java.lang.String loginName, java.lang.String password) throws NotFoundException, AuthenticationException, AlreadyExistsException, java.lang.IllegalArgumentException
UserManagerNote: For use only by Service Administrators.
joinApplication in interface UserManagerloginName - User's login namepassword - User's passwordNotFoundExceptionAuthenticationExceptionAlreadyExistsExceptionjava.lang.IllegalArgumentExceptionpublic User leaveApplication(java.lang.String partnerRef, java.lang.String loginName, java.lang.String password) throws NotFoundException, AuthenticationException, AlreadyExistsException, java.lang.IllegalArgumentException
leaveApplication in interface UserManagerNotFoundExceptionAuthenticationExceptionAlreadyExistsExceptionjava.lang.IllegalArgumentExceptionpublic User persist(UserBuilder ub) throws AlreadyExistsException, NotFoundException
UserManagerUser object, creating an external reference linking the user to the current partner reference.persist in interface UserManagerub - Contains the data necessary for creating a new user.
The minimal data necessary:
AlreadyExistsExceptionNotFoundExceptionpublic User persist(UserBuilder ub, java.util.UUID reservation) throws AlreadyExistsException, NotFoundException
UserManagerUser object, creating an external reference linking the user to the current partner reference.persist in interface UserManagerub - Contains the data necessary for creating a new user. See UserManager.persist(UserBuilder).reservation - A reservation for a login name returned from UserManager.reserveLoginName(String).AlreadyExistsExceptionNotFoundExceptionpublic User getUser(XInfo xinfo) throws NotFoundException
UserManagergetUser in interface UserManagerxinfo - External reference informationNotFoundExceptionpublic User getUser(java.lang.String accessToken) throws NotFoundException
UserManagergetUser in interface UserManageraccessToken - Access tokenNotFoundException - If the access token does not exist.public User findByLogin(java.lang.String loginName) throws NotFoundException
UserManagerfindByLogin in interface UserManagerloginName - The user's login nameNotFoundException - No user is found with that login name.public User findByLogin(java.lang.String partnerRef, java.lang.String loginName) throws NotFoundException
UserManagerNote: For use only by Service Administrators.
findByLogin in interface UserManagerpartnerRef - Partner referenceloginName - The user's login nameNotFoundException - No user is found with that login name.public java.util.List<java.lang.String> findJoinedApplications(java.lang.String loginName)
throws NotFoundException
UserManagerfindJoinedApplications in interface UserManagerloginName - User's login nameNotFoundExceptionpublic void update(XInfo xInfo, java.util.List<Pair<UserManager.UpdateField,java.lang.Object>> values) throws ForbiddenException, NotFoundException
update in interface UserManagerForbiddenExceptionNotFoundExceptionpublic void changePassword(XInfo xinfo, java.lang.String newPassword) throws NotFoundException
changePassword in interface UserManagerNotFoundExceptionpublic void logout()
logout in interface UserManager