Class GuavaAuthenticationCache
- java.lang.Object
-
- org.craftercms.security.authentication.impl.GuavaAuthenticationCache
-
- All Implemented Interfaces:
AuthenticationCache
public class GuavaAuthenticationCache extends Object implements AuthenticationCache
Implementation ofAuthenticationCache
that uses a GuavaCache
.- Since:
- 4.0.0
- Author:
- avasquez, joseross
-
-
Field Summary
Fields Modifier and Type Field Description protected com.google.common.cache.Cache<String,Authentication>
cache
-
Constructor Summary
Constructors Constructor Description GuavaAuthenticationCache(com.google.common.cache.Cache<String,Authentication> cache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Authentication
getAuthentication(String ticket)
Returns the cached authentication for the given ticket.void
putAuthentication(Authentication authentication)
Puts the specified authentication in the cache.void
removeAuthentication(String ticket)
Removes the authentication associated to the given ticket from the cache.
-
-
-
Field Detail
-
cache
protected com.google.common.cache.Cache<String,Authentication> cache
-
-
Constructor Detail
-
GuavaAuthenticationCache
@ConstructorProperties("cache") public GuavaAuthenticationCache(com.google.common.cache.Cache<String,Authentication> cache)
-
-
Method Detail
-
getAuthentication
public Authentication getAuthentication(String ticket)
Description copied from interface:AuthenticationCache
Returns the cached authentication for the given ticket.- Specified by:
getAuthentication
in interfaceAuthenticationCache
-
putAuthentication
public void putAuthentication(Authentication authentication)
Description copied from interface:AuthenticationCache
Puts the specified authentication in the cache.- Specified by:
putAuthentication
in interfaceAuthenticationCache
-
removeAuthentication
public void removeAuthentication(String ticket)
Description copied from interface:AuthenticationCache
Removes the authentication associated to the given ticket from the cache.- Specified by:
removeAuthentication
in interfaceAuthenticationCache
-
-