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

    Fields
    Modifier and Type
    Field
    Description
    private 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

    Constructors
    Constructor
    Description
    SecurityContextUserServiceImpl(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 Type
    Method
    Description
    org.springframework.security.core.userdetails.UserDetails
    Implemented as read-only transactional
    void

    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

      private final String systemUsername
    • userService

      private final UserService 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

      public void onApplicationEvent(UserEvent event)
      Specified by:
      onApplicationEvent in interface org.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 interface org.springframework.security.core.userdetails.UserDetailsService
      Throws:
      org.springframework.security.core.userdetails.UsernameNotFoundException