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 TypeMethodDescriptionvoid
asyncCommit
(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage, Consumer<DatabaseUpdate> databaseUpdates) Asynchronously commits the transaction.void
asyncRollback
(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:NonBlockingTransaction
Asynchronously commits the transaction.The implementation should not block the thread and add any (or none)
CompletionStage
into thestage
.Any blocking operation should be consumed by the
databaseUpdates
. It will be executed at a later instant.- Specified by:
asyncCommit
in interfaceNonBlockingTransaction
- Parameters:
stage
- TheAggregateCompletionStage
to collect theCompletionStage
.databaseUpdates
- TheConsumer
to use for blocking/database updates.
-
asyncRollback
public void asyncRollback(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage) Description copied from interface:NonBlockingTransaction
Asynchronously rollbacks the transaction.The implementation should not block the thread and add any (or none)
CompletionStage
into thestage
.- Specified by:
asyncRollback
in interfaceNonBlockingTransaction
- Parameters:
stage
- TheAggregateCompletionStage
to 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)
-