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.voidputAccessToken(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:AccessTokenCacheFind not expired access token from cache.- Specified by:
findAccessTokenin interfaceAccessTokenCache- Parameters:
key- the key- Returns:
- the access token
-
putAccessToken
public void putAccessToken(String key, String accessToken)
Description copied from interface:AccessTokenCachePut new access token into the cache.- Specified by:
putAccessTokenin interfaceAccessTokenCache- Parameters:
key- the keyaccessToken- the access token
-
-