org.springframework.security.core.userdetails.memory
Class InMemoryDaoImpl
java.lang.Object
org.springframework.security.core.userdetails.memory.InMemoryDaoImpl
- All Implemented Interfaces:
- org.springframework.beans.factory.InitializingBean, UserDetailsService
public class InMemoryDaoImpl
- extends java.lang.Object
- implements UserDetailsService, org.springframework.beans.factory.InitializingBean
Retrieves user details from an in-memory list created in the application context.
Username lookups are case-insensitive.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
InMemoryDaoImpl
public InMemoryDaoImpl()
afterPropertiesSet
public void afterPropertiesSet()
throws java.lang.Exception
- Specified by:
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
- Throws:
java.lang.Exception
getUserMap
public UserMap getUserMap()
loadUserByUsername
public UserDetails loadUserByUsername(java.lang.String username)
throws UsernameNotFoundException,
org.springframework.dao.DataAccessException
- Description copied from interface:
UserDetailsService
- Locates the user based on the username. In the actual implementation, the search may possibly be case
insensitive, or case insensitive depending on how the implementation instance is configured. In this case, the
UserDetails
object that comes back may have a username that is of a different case than what was
actually requested..
- Specified by:
loadUserByUsername
in interface UserDetailsService
- Parameters:
username
- the username identifying the user whose data is required.
- Returns:
- a fully populated user record (never
null
)
- Throws:
UsernameNotFoundException
- if the user could not be found or the user has no GrantedAuthority
org.springframework.dao.DataAccessException
- if user could not be found for a repository-specific reason
setUserMap
public void setUserMap(UserMap userMap)
setUserProperties
public void setUserProperties(java.util.Properties props)
- Modifies the internal
UserMap
to reflect the Properties
instance passed. This
helps externalise user information to another file etc.
- Parameters:
props
- the account information in a Properties
object format