R - the generic typeT - the generic typepublic interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>
extends org.springframework.security.core.userdetails.UserDetailsService
| Modifier and Type | Field and Description |
|---|---|
static String |
SYSTEM_ADMIN
The system admin.
|
| 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.
|
Collection<R> |
getDefaultUserRoles()
Get default roles assigned to users.
|
T |
getUser(long id)
Get User by id.
|
T |
getUserByEmail(String email)
Get User by email.
|
List<R> |
listAvailableRoles()
List available roles.
|
void |
setAccountLock(long userId,
boolean locked)
Sets the account lock.
|
void |
setAccountLockLocal(long userId,
boolean locked)
Lock user account.
|
T |
setAccountType(T user,
BasicUser.AccountType accountType)
Sets the account type.
|
T |
setRoles(T user,
Set<R> roles)
Grant specified roles to user.
|
void |
updateLastLogin(String userName)
Update user's last login date.
|
T |
updateUser(T user,
String email,
String fullName)
Update user information.
|
static final String SYSTEM_ADMIN
T getUser(long id)
id - the idnullT getUserByEmail(String email)
email - the emailT createUser(String email, String fullName, String password, BasicUser.AccountType accountType) throws NotUniqueUserException, PasswordPolicy.PasswordPolicyException, UserException
email - unique email addressfullName - Full namepassword - initial account passwordaccountType - account typeNotUniqueUserException - user is not unique in the systemPasswordPolicy.PasswordPolicyException - password violates current password policyUserException - any other exceptionT setRoles(T user, Set<R> roles)
getDefaultUserRoles() will not be
persisted.user - the userroles - the rolesT updateUser(T user, String email, String fullName) throws NotUniqueUserException, UserException
user - the useremail - new email addressfullName - new fullNameNotUniqueUserException - when email address is already registeredUserException - a generic user service exceptionT changePassword(T user, String password) throws PasswordPolicy.PasswordPolicyException
user - the userpassword - new passwordPasswordPolicy.PasswordPolicyException - the password policy exceptionvoid deleteUser(T user)
user - user to deletevoid setAccountLockLocal(long userId,
boolean locked)
throws NoUserFoundException
userId - the user idlocked - Is account lockedNoUserFoundException - the no user found exceptionvoid setAccountLock(long userId,
boolean locked)
throws NoUserFoundException
userId - the user idlocked - the lockedNoUserFoundException - the no user found exceptionCollection<R> getDefaultUserRoles()
T setAccountType(T user, BasicUser.AccountType accountType)
user - the useraccountType - the account typevoid updateLastLogin(String userName) throws NoUserFoundException
userName - the user nameNoUserFoundException - if username not found in the systemCopyright © 2020 Global Crop Diversity Trust. All rights reserved.