Class InfinispanCodeToTokenStoreProvider
- java.lang.Object
-
- org.keycloak.models.sessions.infinispan.InfinispanCodeToTokenStoreProvider
-
- All Implemented Interfaces:
CodeToTokenStoreProvider
,Provider
public class InfinispanCodeToTokenStoreProvider extends Object implements CodeToTokenStoreProvider
- Author:
- Marek Posolda
-
-
Field Summary
Fields Modifier and Type Field Description static org.jboss.logging.Logger
logger
-
Constructor Summary
Constructors Constructor Description InfinispanCodeToTokenStoreProvider(KeycloakSession session, Supplier<org.infinispan.commons.api.BasicCache<UUID,ActionTokenValueEntity>> actionKeyCache)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
put(UUID codeId, int lifespanSeconds, Map<String,String> codeData)
Stores the given data and guarantees that data should be available in the store for at least the time specified by {@param lifespanSeconds} parameterMap<String,String>
remove(UUID codeId)
This method returns data just if removal was successful.
-
-
-
Constructor Detail
-
InfinispanCodeToTokenStoreProvider
public InfinispanCodeToTokenStoreProvider(KeycloakSession session, Supplier<org.infinispan.commons.api.BasicCache<UUID,ActionTokenValueEntity>> actionKeyCache)
-
-
Method Detail
-
put
public void put(UUID codeId, int lifespanSeconds, Map<String,String> codeData)
Description copied from interface:CodeToTokenStoreProvider
Stores the given data and guarantees that data should be available in the store for at least the time specified by {@param lifespanSeconds} parameter- Specified by:
put
in interfaceCodeToTokenStoreProvider
-
remove
public Map<String,String> remove(UUID codeId)
Description copied from interface:CodeToTokenStoreProvider
This method returns data just if removal was successful. Implementation should guarantee that "remove" is single-use. So if 2 threads (even on different cluster nodes or on different cross-dc nodes) calls "remove(123)" concurrently, then just one of them is allowed to succeed and return data back. It can't happen that both will succeed.- Specified by:
remove
in interfaceCodeToTokenStoreProvider
- Returns:
- context data related to OAuth2 code. It returns null if there are not context data available.
-
-