Package org.openwms.core.uaa.impl
Class SecurityContextUserServiceImpl
java.lang.Object
org.openwms.core.uaa.impl.SecurityContextUserServiceImpl
- All Implemented Interfaces:
EventListener
,org.springframework.context.ApplicationListener<UserEvent>
,org.springframework.security.core.userdetails.UserDetailsService
@TxService
class SecurityContextUserServiceImpl
extends Object
implements org.springframework.security.core.userdetails.UserDetailsService, org.springframework.context.ApplicationListener<UserEvent>
A SecurityContextUserServiceImpl extends Spring
UserDetailsService
to
read User
s and Role
s from the persistent storage and wraps them into security objects.- Author:
- Tina Russell
-
Field Summary
Modifier and TypeFieldDescriptionprivate final org.ehcache.core.Ehcache
private final org.springframework.security.crypto.password.PasswordEncoder
private final String
private final org.springframework.security.core.userdetails.UserCache
private final UserService
-
Constructor Summary
ConstructorDescriptionSecurityContextUserServiceImpl
(String systemUsername, UserService userService, org.springframework.security.core.userdetails.UserCache userCache, org.ehcache.core.Ehcache cache, org.springframework.security.crypto.password.PasswordEncoder enc) -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.security.core.userdetails.UserDetails
loadUserByUsername
(String username) Implemented as read-only transactionalvoid
onApplicationEvent
(UserEvent event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.springframework.context.ApplicationListener
supportsAsyncExecution
-
Field Details
-
systemUsername
-
userService
-
userCache
private final org.springframework.security.core.userdetails.UserCache userCache -
cache
private final org.ehcache.core.Ehcache cache -
enc
private final org.springframework.security.crypto.password.PasswordEncoder enc
-
-
Constructor Details
-
SecurityContextUserServiceImpl
public SecurityContextUserServiceImpl(@Value("${owms.security.system.username:}") String systemUsername, UserService userService, @Autowired(required=false) org.springframework.security.core.userdetails.UserCache userCache, @Autowired(required=false) org.ehcache.core.Ehcache cache, org.springframework.security.crypto.password.PasswordEncoder enc)
-
-
Method Details
-
onApplicationEvent
- Specified by:
onApplicationEvent
in interfaceorg.springframework.context.ApplicationListener<UserEvent>
-
loadUserByUsername
@Transactional(readOnly=true) @Measured public org.springframework.security.core.userdetails.UserDetails loadUserByUsername(String username) throws org.springframework.security.core.userdetails.UsernameNotFoundException Implemented as read-only transactional- Specified by:
loadUserByUsername
in interfaceorg.springframework.security.core.userdetails.UserDetailsService
- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-