public class

UserMap

extends Object
java.lang.Object
   ↳ org.springframework.security.core.userdetails.memory.UserMap

This class is deprecated.
Use a plain map instead

Class Overview

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

Usernames are used as the lookup key and are stored in lower case, to allow case-insensitive lookups. So this class should not be used if usernames need to be case-sensitive.

Summary

Public Constructors
UserMap()
Public Methods
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<StringUserDetails> users)
Set the users in this UserMap.
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public UserMap ()

Public Methods

public void addUser (UserDetails user)

Adds a user to the in-memory map.

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

public UserDetails getUser (String username)

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

public int getUserCount ()

Indicates the size of the user map.

Returns
  • the number of users in the map

public void setUsers (Map<StringUserDetails> users)

Set the users in this UserMap. Overrides previously added users.

Parameters
users Map <String, UserDetails> with pairs (username, userdetails)