public interface DuracloudUserService
| 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) |
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.
|
@Secured(value="role:ROLE_ANONYMOUS, scope:ANY") void checkUsername(String username) throws InvalidUsernameException, UserAlreadyExistsException
username - soughtInvalidUsernameExceptionUserAlreadyExistsException@Secured(value="role:ROLE_ANONYMOUS, scope:ANY") org.duracloud.account.db.model.DuracloudUser createNewUser(String username, String password, String firstName, String lastName, String email, String securityQuestion, String securityAnswer) throws UserAlreadyExistsException, InvalidUsernameException
username - of new userpassword - of new userfirstName - of new userlastName - of new useremail - of new usersecurityQuestion - of new usersecurityAnswer - of new userUserAlreadyExistsExceptionInvalidUsernameException@Secured(value="role:ROLE_ADMIN, scope:SELF_ACCT_PEER_UPDATE") boolean setUserRights(Long acctId, Long userId, org.duracloud.account.db.model.Role... roles)
@Secured(value="role:ROLE_ADMIN, scope:SELF_ACCT") boolean addUserToAccount(Long acctId, Long userId) throws DBNotFoundException
DBNotFoundException@Secured(value="role:ROLE_ADMIN, scope:SELF_ACCT_PEER") void revokeUserRights(Long acctId, Long userId)
acctId - on which rights will be revokeduserId - of user whose rights will be revoked@Secured(value="role:ROLE_USER, scope:SELF_ID") void changePassword(Long userId, String oldPassword, boolean oldPasswordEncoded, String newPassword) throws DBNotFoundException, InvalidPasswordException
userId - of user who is seeking a password changeoldPassword - oldPasswordEncoded - flag noting if the password is hashednewPassword - InvalidPasswordExceptionDBNotFoundException@Secured(value="role:ROLE_ANONYMOUS, scope:ANY") void changePasswordInternal(Long userId, String oldPassword, boolean oldPasswordEncoded, String newPassword) throws DBNotFoundException, InvalidPasswordException
userId - oldPassword - oldPasswordEncoded - newPassword - InvalidPasswordExceptionDBNotFoundException@Secured(value="role:ROLE_ANONYMOUS, scope:ANY") void forgotPassword(String username, String securityQuestion, String securityAnswer) throws DBNotFoundException, InvalidPasswordException, UnsentEmailException
username - of user who forgot their passwordsecurityQuestion - of user who forgot their passwordsecurityAnswer - of user who forgot their passwordInvalidPasswordExceptionUnsentEmailExceptionDBNotFoundException@Secured(value="role:ROLE_ANONYMOUS, scope:ANY") org.duracloud.account.db.model.UserInvitation retrievePassordChangeInvitation(String redemptionCode) throws DBNotFoundException
redemptionCode - DBNotFoundException@Secured(value="role:ROLE_USER, scope:SELF_NAME") org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByUsername(String username) throws DBNotFoundException
username - of user to loadDBNotFoundException@Secured(value="role:ROLE_ANONYMOUS, scope:ANY") org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByUsernameInternal(String username) throws DBNotFoundException
DBNotFoundException@Secured(value="role:ROLE_USER, scope:ANY") org.duracloud.account.db.model.DuracloudUser loadDuracloudUserByIdInternal(Long userId) throws DBNotFoundException
DBNotFoundException@Secured(value="role:ROLE_USER, scope:SELF_ID") Long redeemAccountInvitation(Long userId, String redemptionCode) throws InvalidRedemptionCodeException
userId - 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 accountInvalidRedemptionCodeException@Secured(value="role:ROLE_ANONYMOUS, scope:ANY") void redeemPasswordChangeRequest(Long userId, String redemptionCode) throws InvalidRedemptionCodeException
InvalidRedemptionCodeException@Secured(value="role:ROLE_USER, scope:SELF_ID") void storeUserDetails(Long userId, String firstName, String lastName, String email, String securityQuestion, String securityAnswer, String allowableIPAddressRange) throws DBNotFoundException
userId - of userfirstName - of userlastName - of useremail - of usersecurityQuestion - of usersecurityAnswer - of userallowableIPAddressRange - DBNotFoundExceptionCopyright © 2009–2016 DuraSpace. All rights reserved.