public interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>
extends org.springframework.security.core.userdetails.UserDetailsService
| Modifier and Type | Method and Description |
|---|---|
T |
changePassword(T user,
String password)
Change password
|
T |
createUser(String email,
String fullName,
String password,
BasicUser.AccountType accountType)
Create a new user account
|
void |
deleteUser(T user)
Try to delete user.
|
T |
getUser(long id)
Get User by id
|
T |
getUserByEmail(String email)
Get User by email
|
void |
setAccountLock(long userId,
boolean locked) |
void |
setAccountLockLocal(long userId,
boolean locked)
Lock user account
|
T |
setRoles(T user,
Set<R> roles)
Grant specified roles to user.
|
T |
updateUser(T user,
String email,
String fullName)
Update user information
|
T getUser(long id) throws NoUserFoundException
id - nullNoUserFoundExceptionT getUserByEmail(String email) throws org.springframework.security.core.userdetails.UsernameNotFoundException
email - org.springframework.security.core.userdetails.UsernameNotFoundExceptionT createUser(String email, String fullName, String password, BasicUser.AccountType accountType) throws NotUniqueUserException, PasswordPolicy.PasswordPolicyException, UserException
email - unique email addressfullName - Full namepassword - initial account passwordaccountType - TODOPasswordPolicy.PasswordPolicyException - password violates current password policyNotUniqueUserException - user is not unique in the systemUserException - any other exceptionT setRoles(T user, Set<R> roles)
UserRole#USER will be added if missing.user - roles - T updateUser(T user, String email, String fullName) throws NotUniqueUserException
user - the useremail - new email addressfullName - new fullNameNotUniqueUserExceptionT changePassword(T user, String password) throws PasswordPolicy.PasswordPolicyException
user - the userpassword - new passwordPasswordPolicy.PasswordPolicyExceptionvoid deleteUser(T user)
user - user to deletevoid setAccountLockLocal(long userId,
boolean locked)
throws NoUserFoundException
userID - User IDlocked - Is account lockedNoUserFoundExceptionvoid setAccountLock(long userId,
boolean locked)
throws NoUserFoundException
NoUserFoundExceptionCopyright © 2017 Global Crop Diversity Trust. All rights reserved.