Class RedisAccessTokenCache
- java.lang.Object
-
- org.bremersee.security.authentication.RedisAccessTokenCache
-
- All Implemented Interfaces:
AccessTokenCache
public class RedisAccessTokenCache extends Object implements AccessTokenCache
The redis access token cache.- Author:
- Christian Bremer
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.bremersee.security.authentication.AccessTokenCache
AccessTokenCache.Builder
-
-
Field Summary
-
Fields inherited from interface org.bremersee.security.authentication.AccessTokenCache
CACHE_NAME
-
-
Constructor Summary
Constructors Constructor Description RedisAccessTokenCache(AuthProperties.JwtCache jwtCacheProperties, org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
Instantiates a new redis access token cache.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Optional<String>
findAccessToken(String key)
Find not expired access token from cache.void
putAccessToken(String key, String accessToken)
Put new access token into the cache.
-
-
-
Constructor Detail
-
RedisAccessTokenCache
public RedisAccessTokenCache(AuthProperties.JwtCache jwtCacheProperties, org.springframework.data.redis.connection.RedisConnectionFactory connectionFactory)
Instantiates a new redis access token cache.- Parameters:
jwtCacheProperties
- the jwt cache propertiesconnectionFactory
- the connection factory
-
-
Method Detail
-
findAccessToken
public Optional<String> findAccessToken(String key)
Description copied from interface:AccessTokenCache
Find not expired access token from cache.- Specified by:
findAccessToken
in interfaceAccessTokenCache
- Parameters:
key
- the key- Returns:
- the access token
-
putAccessToken
public void putAccessToken(String key, String accessToken)
Description copied from interface:AccessTokenCache
Put new access token into the cache.- Specified by:
putAccessToken
in interfaceAccessTokenCache
- Parameters:
key
- the keyaccessToken
- the access token
-
-