Class InfinispanKeycloakTransaction
java.lang.Object
org.keycloak.models.sessions.infinispan.InfinispanKeycloakTransaction
- All Implemented Interfaces:
NonBlockingTransaction
- Author:
- Stian Thorgersen
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidasyncCommit(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates) Asynchronously commits the transaction.voidasyncRollback(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage) Asynchronously rollbacks the transaction.<K,V> V get(org.infinispan.commons.api.BasicCache<K, V> cache, K key) <K,V> void put(org.infinispan.commons.api.BasicCache<K, V> cache, K key, V value, long lifespan, TimeUnit lifespanUnit) <K,V> void remove(org.infinispan.commons.api.BasicCache<K, V> cache, K key) <K,V> void
-
Constructor Details
-
InfinispanKeycloakTransaction
public InfinispanKeycloakTransaction()
-
-
Method Details
-
asyncCommit
public void asyncCommit(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates) Description copied from interface:NonBlockingTransactionAsynchronously commits the transaction.The implementation should not block the thread and add any (or none)
CompletionStageinto thestage.Any blocking operation should be consumed by the
databaseUpdates. It will be executed at a later instant.- Specified by:
asyncCommitin interfaceNonBlockingTransaction- Parameters:
stage- TheAggregateCompletionStageto collect theCompletionStage.databaseUpdates- TheConsumerto use for blocking/database updates.
-
asyncRollback
public void asyncRollback(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage) Description copied from interface:NonBlockingTransactionAsynchronously rollbacks the transaction.The implementation should not block the thread and add any (or none)
CompletionStageinto thestage.- Specified by:
asyncRollbackin interfaceNonBlockingTransaction- Parameters:
stage- TheAggregateCompletionStageto collect theCompletionStage.
-
put
public <K,V> void put(org.infinispan.commons.api.BasicCache<K, V> cache, K key, V value, long lifespan, TimeUnit lifespanUnit) -
replace
public <K,V> void replace(org.infinispan.Cache<K, V> cache, K key, V value, long lifespan, TimeUnit lifespanUnit) -
remove
public <K,V> void remove(org.infinispan.commons.api.BasicCache<K, V> cache, K key) -
get
public <K,V> V get(org.infinispan.commons.api.BasicCache<K, V> cache, K key)
-