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

java.lang.Object
  extended by org.springframework.security.core.userdetails.memory.UserMap

public class UserMap
extends Object

Used by InMemoryDaoImpl to store a list of users and their corresponding granted authorities.

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

Constructor Summary
UserMap()
           
 
Method Summary
 void addUser(UserDetails user)
          Adds a user to the in-memory map.
 UserDetails getUser(String username)
          Locates the specified user by performing a case insensitive search by username.
 int getUserCount()
          Indicates the size of the user map.
 void setUsers(Map<String,UserDetails> users)
          Set the users in this UserMap.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserMap

public UserMap()
Method Detail

addUser

public void addUser(UserDetails user)
             throws IllegalArgumentException
Adds a user to the in-memory map.

Parameters:
user - the user to be stored
Throws:
IllegalArgumentException - if a null User was passed

getUser

public UserDetails getUser(String username)
                    throws UsernameNotFoundException
Locates the specified user by performing a case insensitive search by username.

Parameters:
username - to find
Returns:
the located user
Throws:
UsernameNotFoundException - if the user could not be found

getUserCount

public int getUserCount()
Indicates the size of the user map.

Returns:
the number of users in the map

setUsers

public void setUsers(Map<String,UserDetails> users)
Set the users in this UserMap. Overrides previously added users.

Parameters:
users - Map <String, UserDetails> with pairs (username, userdetails)
Since:
1.1


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