Class NullUserCache
java.lang.Object
org.springframework.security.core.userdetails.cache.NullUserCache
- All Implemented Interfaces:
UserCache
Does not perform any caching.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetUserFromCache(String username) Obtains aUserDetailsfrom the cache.voidputUserInCache(UserDetails user) Places aUserDetailsin the cache.voidremoveUserFromCache(String username) Removes the specified user from the cache.
-
Constructor Details
-
NullUserCache
public NullUserCache()
-
-
Method Details
-
getUserFromCache
Description copied from interface:UserCacheObtains aUserDetailsfrom the cache.- Specified by:
getUserFromCachein interfaceUserCache- Parameters:
username- theUser.getUsername()used to place the user in the cache- Returns:
- the populated
UserDetailsornullif the user could not be found or if the cache entry has expired
-
putUserInCache
Description copied from interface:UserCachePlaces aUserDetailsin the cache. Theusernameis the key used to subsequently retrieve theUserDetails.- Specified by:
putUserInCachein interfaceUserCache- Parameters:
user- the fully populatedUserDetailsto place in the cache
-
removeUserFromCache
Description copied from interface:UserCacheRemoves the specified user from the cache. Theusernameis the key used to remove the user. If the user is not found, the method should simply return (not thrown an exception).Some cache implementations may not support eviction from the cache, in which case they should provide appropriate behaviour to alter the user in either its documentation, via an exception, or through a log message.
- Specified by:
removeUserFromCachein interfaceUserCache- Parameters:
username- to be evicted from the cache
-