Class InfinispanSingleUseTokenStoreProvider
- java.lang.Object
-
- org.keycloak.models.sessions.infinispan.InfinispanSingleUseTokenStoreProvider
-
- All Implemented Interfaces:
SingleUseTokenStoreProvider
,Provider
public class InfinispanSingleUseTokenStoreProvider extends Object implements SingleUseTokenStoreProvider
TODO: Check if Boolean can be used as single-use cache argument instead of ActionTokenValueEntity. With respect to other single-use cache usecases like "Revoke Refresh Token" . Also with respect to the usage of streams iterating over "actionTokens" cache (check there are no ClassCastExceptions when casting values directly to ActionTokenValueEntity)- Author:
- Marek Posolda
-
-
Field Summary
Fields Modifier and Type Field Description static org.jboss.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description InfinispanSingleUseTokenStoreProvider(KeycloakSession session, Supplier<org.infinispan.commons.api.BasicCache<String,ActionTokenValueEntity>> actionKeyCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
boolean
putIfAbsent(String tokenId, int lifespanInSeconds)
Will try to put the token into the cache.
-
-
-
Constructor Detail
-
InfinispanSingleUseTokenStoreProvider
public InfinispanSingleUseTokenStoreProvider(KeycloakSession session, Supplier<org.infinispan.commons.api.BasicCache<String,ActionTokenValueEntity>> actionKeyCache)
-
-
Method Detail
-
putIfAbsent
public boolean putIfAbsent(String tokenId, int lifespanInSeconds)
Description copied from interface:SingleUseTokenStoreProvider
Will try to put the token into the cache. It will success just if token is not already there.- Specified by:
putIfAbsent
in interfaceSingleUseTokenStoreProvider
lifespanInSeconds
- Minimum lifespan for which successfully added token will be kept in the cache.- Returns:
- true if token was successfully put into the cache. This means that same token wasn't in the cache before
-
-