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 Users and Roles from the persistent storage and wraps them into security objects.- Author:
- Tina Russell
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.ehcache.core.Ehcacheprivate final org.springframework.security.crypto.password.PasswordEncoderprivate final Stringprivate final org.springframework.security.core.userdetails.UserCacheprivate final UserService -
Constructor Summary
ConstructorsConstructorDescriptionSecurityContextUserServiceImpl(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.UserDetailsloadUserByUsername(String username) Implemented as read-only transactionalvoidonApplicationEvent(UserEvent event) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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:
onApplicationEventin 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:
loadUserByUsernamein interfaceorg.springframework.security.core.userdetails.UserDetailsService- Throws:
org.springframework.security.core.userdetails.UsernameNotFoundException
-