org.springframework.security.core.userdetails.memory
Class InMemoryDaoImpl

java.lang.Object
  extended by org.springframework.security.core.userdetails.memory.InMemoryDaoImpl
All Implemented Interfaces:
InitializingBean, UserDetailsService

public class InMemoryDaoImpl
extends Object
implements UserDetailsService, InitializingBean

Retrieves user details from an in-memory list created by the bean context.

Version:
$Id: InMemoryDaoImpl.java 3558 2009-04-15 07:39:21Z ltaylor $
Author:
Ben Alex

Constructor Summary
InMemoryDaoImpl()
           
 
Method Summary
 void afterPropertiesSet()
           
 UserMap getUserMap()
           
 UserDetails loadUserByUsername(String username)
          Locates the user based on the username.
 void setUserMap(UserMap userMap)
           
 void setUserProperties(Properties props)
          Modifies the internal UserMap to reflect the Properties instance passed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InMemoryDaoImpl

public InMemoryDaoImpl()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface InitializingBean
Throws:
Exception

getUserMap

public UserMap getUserMap()

loadUserByUsername

public UserDetails loadUserByUsername(String username)
                               throws UsernameNotFoundException,
                                      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 presented to the DaoAuthenticationProvider
Returns:
a fully populated user record (never null)
Throws:
UsernameNotFoundException - if the user could not be found or the user has no GrantedAuthority
DataAccessException - if user could not be found for a repository-specific reason

setUserMap

public void setUserMap(UserMap userMap)

setUserProperties

public void setUserProperties(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


Copyright © 2004-2009 SpringSource, Inc. All Rights Reserved.