@Transactional(readOnly=true) public abstract class BasicUserServiceImpl<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>> extends Object implements BasicUserService<R,T>
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
LOG |
protected org.springframework.security.crypto.password.PasswordEncoder |
passwordEncoder |
| Constructor and Description |
|---|
BasicUserServiceImpl() |
| Modifier and Type | Method and Description |
|---|---|
void |
assureGoodPassword(String password)
Test if password passes the password policy (if set)
|
T |
changePassword(T user,
String password)
Change password
|
void |
deleteUser(T user)
Try to delete user.
|
T |
getUser(long id)
Get User by id
|
org.springframework.security.core.userdetails.UserDetails |
loadUserByUsername(String username) |
void |
setAccountLock(long userId,
boolean locked) |
void |
setAccountLockLocal(long userId,
boolean locked)
For internal use only.
|
void |
setAccountLockoutTime(long accountLockoutTime) |
protected void |
setPassword(T user,
String password) |
T |
setRoles(T user,
Set<R> newRoles)
Grant specified roles to user.
|
T |
updateUser(T user,
String email,
String fullName)
Update user information
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcreateUser, getUserByEmailpublic static final org.slf4j.Logger LOG
@Autowired(required=false) protected final org.springframework.security.crypto.password.PasswordEncoder passwordEncoder
public void setAccountLockoutTime(long accountLockoutTime)
public 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 T getUser(long id) throws NoUserFoundException
BasicUserServicegetUser in interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>nullNoUserFoundException@Transactional public T updateUser(T user, String email, String fullName)
BasicUserServiceupdateUser in interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>user - the useremail - new email addressfullName - new fullName@Transactional public void deleteUser(T user)
BasicUserServicedeleteUser in interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>user - user to delete@Transactional public T setRoles(T user, Set<R> newRoles)
BasicUserServiceUserRole#USER will be added if missing.@Transactional public T changePassword(T user, String password) throws PasswordPolicy.PasswordPolicyException
BasicUserServicechangePassword in interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>user - the userpassword - new passwordPasswordPolicy.PasswordPolicyExceptionprotected void setPassword(T user, String password) throws PasswordPolicy.PasswordPolicyException
public void assureGoodPassword(String password) throws PasswordPolicy.PasswordPolicyException
password - candidate passwordPasswordPolicy.PasswordPolicyException - if password does not match policy@Transactional
public void setAccountLockLocal(long userId,
boolean locked)
throws NoUserFoundException
setAccountLockLocal in interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>locked - Is account lockedNoUserFoundException@Transactional
@PreAuthorize(value="hasRole(\'ADMINISTRATOR\')")
public void setAccountLock(long userId,
boolean locked)
throws NoUserFoundException
setAccountLock in interface BasicUserService<R extends org.springframework.security.core.GrantedAuthority,T extends BasicUser<R>>NoUserFoundExceptionCopyright © 2017 Global Crop Diversity Trust. All rights reserved.