Spring Security Framework

org.springframework.security.userdetails.memory
Class UserMap

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

public class UserMap
extends Object

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

Version:
$Id$
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 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 users)
Set the users in this UserMap. Overrides previously added users.

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

Spring Security Framework

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