public class DuracloudUserServiceImpl extends Object implements DuracloudUserService, org.springframework.security.core.userdetails.UserDetailsService
| Constructor and Description |
|---|
DuracloudUserServiceImpl(org.duracloud.account.db.repo.DuracloudRepoMgr duracloudRepoMgr,
NotificationMgr notificationMgr,
UserDetailsPropagator propagator,
AmaEndpoint amaEndpoint) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addUserToAccount(Long acctId,
Long userId)
This method sets the roles of a user in an account.
|
void |
changePassword(Long userId,
String oldPassword,
boolean oldPasswordEncoded,
String newPassword)
This method changes the password of the user with the arg userId from
the oldPassword to the newPassword.
|
void |
changePasswordInternal(Long userId,
String oldPassword,
boolean oldPasswordEncoded,
String newPassword) |
void |
checkUsername(String username)
This method throws an exception is the username is non-unique or
it is not a valid username.
|
org.duracloud.account.db.model.DuracloudUser |
createNewUser(String username,
String password,
String firstName,
String lastName,
String email,
String securityQuestion,
String securityAnswer)
This method creates and persists a new user.
|
void |
forgotPassword(String username,
String securityQuestion,
String securityAnswer)
This method generates a random password, replaces the existing password
with the randomly generated one, and sends an email to the address on
file for the given username.
|
org.duracloud.account.db.model.DuracloudUser |
loadDuracloudUserByIdInternal(Long userId) |
org.duracloud.account.db.model.DuracloudUser |
loadDuracloudUserByUsername(String username)
This method loads a DuracloudUser from the persistence layer and
populate its rights info.
|
org.duracloud.account.db.model.DuracloudUser |
loadDuracloudUserByUsernameInternal(String username) |
org.springframework.security.core.userdetails.UserDetails |
loadUserByUsername(String username) |
Long |
redeemAccountInvitation(Long userId,
String redemptionCode)
This method redeems an invitation to add this user to a DuraCloud
account.
|
void |
redeemPasswordChangeRequest(Long userId,
String redemptionCode) |
org.duracloud.account.db.model.UserInvitation |
retrievePassordChangeInvitation(String redemptionCode)
Returns a user password change invitation
|
void |
revokeUserRights(Long acctId,
Long userId)
This method removes all rights to an account for a given user.
|
boolean |
setUserRights(Long acctId,
Long userId,
org.duracloud.account.db.model.Role... roles)
This method sets the roles of a user in an account.
|
void |
storeUserDetails(Long userId,
String firstName,
String lastName,
String email,
String securityQuestion,
String securityAnswer,
String allowableIPAddressRange)
This method persists the arg user details.
|
public DuracloudUserServiceImpl(org.duracloud.account.db.repo.DuracloudRepoMgr duracloudRepoMgr,
NotificationMgr notificationMgr,
UserDetailsPropagator propagator,
AmaEndpoint amaEndpoint)
public void checkUsername(String username) throws InvalidUsernameException, UserAlreadyExistsException
DuracloudUserServicecheckUsername in interface DuracloudUserServiceusername - soughtInvalidUsernameExceptionUserAlreadyExistsExceptionpublic org.duracloud.account.db.model.DuracloudUser createNewUser(String username, String password, String firstName, String lastName, String email, String securityQuestion, String securityAnswer) throws UserAlreadyExistsException, InvalidUsernameException
DuracloudUserServicecreateNewUser in interface DuracloudUserServiceusername - of new userpassword - of new userfirstName - of new userlastName - of new useremail - of new usersecurityQuestion - of new usersecurityAnswer - of new userUserAlreadyExistsExceptionInvalidUsernameExceptionpublic boolean setUserRights(Long acctId, Long userId, org.duracloud.account.db.model.Role... roles)
DuracloudUserServicesetUserRights in interface DuracloudUserServicepublic void revokeUserRights(Long acctId, Long userId)
DuracloudUserServicerevokeUserRights in interface DuracloudUserServiceacctId - on which rights will be revokeduserId - of user whose rights will be revokedpublic void changePassword(Long userId, String oldPassword, boolean oldPasswordEncoded, String newPassword) throws DBNotFoundException, InvalidPasswordException
DuracloudUserServicechangePassword in interface DuracloudUserServiceuserId - of user who is seeking a password changeoldPasswordEncoded - flag noting if the password is hashedInvalidPasswordExceptionDBNotFoundExceptionpublic void changePasswordInternal(Long userId, String oldPassword, boolean oldPasswordEncoded, String newPassword) throws DBNotFoundException, InvalidPasswordException
changePasswordInternal in interface DuracloudUserServiceInvalidPasswordExceptionDBNotFoundExceptionpublic void redeemPasswordChangeRequest(Long userId, String redemptionCode) throws InvalidRedemptionCodeException
redeemPasswordChangeRequest in interface DuracloudUserServiceInvalidRedemptionCodeExceptionpublic void forgotPassword(String username, String securityQuestion, String securityAnswer) throws DBNotFoundException, InvalidPasswordException, UnsentEmailException
DuracloudUserServiceforgotPassword in interface DuracloudUserServiceusername - of user who forgot their passwordsecurityQuestion - of user who forgot their passwordsecurityAnswer - of user who forgot their passwordInvalidPasswordExceptionUnsentEmailExceptionDBNotFoundExceptionpublic org.duracloud.account.db.model.UserInvitation retrievePassordChangeInvitation(String redemptionCode) throws DBNotFoundException
DuracloudUserServiceretrievePassordChangeInvitation in interface DuracloudUserServiceDBNotFoundExceptionpublic org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException
loadUserByUsername in interface org.springframework.security.core.userdetails.UserDetailsServiceorg.springframework.security.core.userdetails.UsernameNotFoundExceptionpublic org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByUsername(String username) throws DBNotFoundException
DuracloudUserServiceloadDuracloudUserByUsername in interface DuracloudUserServiceusername - of user to loadDBNotFoundExceptionpublic org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByUsernameInternal(String username) throws DBNotFoundException
loadDuracloudUserByUsernameInternal in interface DuracloudUserServiceDBNotFoundExceptionpublic org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByIdInternal(Long userId) throws DBNotFoundException
loadDuracloudUserByIdInternal in interface DuracloudUserServiceDBNotFoundExceptionpublic Long redeemAccountInvitation(Long userId, String redemptionCode) throws InvalidRedemptionCodeException
DuracloudUserServiceredeemAccountInvitation in interface DuracloudUserServiceuserId - the id of the user which will be added to the account
indicated in the invitationredemptionCode - code which was sent to the user as part of the invitation to
become part of an accountInvalidRedemptionCodeExceptionpublic void storeUserDetails(Long userId, String firstName, String lastName, String email, String securityQuestion, String securityAnswer, String allowableIPAddressRange) throws DBNotFoundException
DuracloudUserServicestoreUserDetails in interface DuracloudUserServiceuserId - of userfirstName - of userlastName - of useremail - of usersecurityQuestion - of usersecurityAnswer - of userDBNotFoundExceptionpublic boolean addUserToAccount(Long acctId, Long userId) throws DBNotFoundException
DuracloudUserServiceaddUserToAccount in interface DuracloudUserServiceDBNotFoundExceptionCopyright © 2009–2015 DuraSpace. All rights reserved.