Class RemoteChangeLogTransaction<K,V,T extends Updater<K,V>,R extends ConditionalRemover<K,V>>
java.lang.Object
org.keycloak.models.sessions.infinispan.remote.transaction.RemoteChangeLogTransaction<K,V,T,R>
- Type Parameters:
K- The type of the Infinispan cache key.V- The type of the Infinispan cache value.T- The type of theUpdaterimplementation.
- All Implemented Interfaces:
NonBlockingTransaction
- Direct Known Subclasses:
AuthenticationSessionChangeLogTransaction,ClientSessionChangeLogTransaction,LoginFailureChangeLogTransaction,UserSessionChangeLogTransaction
public class RemoteChangeLogTransaction<K,V,T extends Updater<K,V>,R extends ConditionalRemover<K,V>>
extends Object
implements NonBlockingTransaction
A
KeycloakTransaction implementation that keeps track of changes made to entities stored in a Infinispan
cache.-
Nested Class Summary
Nested Classes -
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.Tracks a new value to be created in the Infinispan cache.Fetches the value associated to thekey.Nonblocking alternative ofget(Object)getCache()voidRemoves thekeyfrom theRemoteCache.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.sessions.infinispan.transaction.NonBlockingTransaction
lockDatabaseEntities, supportsLockingDatabaseEntities
-
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.
-
getCache
- Returns:
- The
RemoteCachetracked by the transaction.
-
get
Fetches the value associated to thekey.It fetches the value from the
RemoteCacheif a copy does not exist in the transaction.- Parameters:
key- The Infinispan cache key to fetch.- Returns:
- The
Updaterto track further changes of the Infinispan cache value.
-
getAsync
Nonblocking alternative ofget(Object)- Parameters:
key- The Infinispan cache key to fetch.- Returns:
- The
Updaterto track further changes of the Infinispan cache value.
-
create
Tracks a new value to be created in the Infinispan cache.- Parameters:
key- The Infinispan cache key to be associated to the value.entity- The Infinispan cache value.- Returns:
- The
Updaterto track further changes of the Infinispan cache value.
-
remove
Removes thekeyfrom theRemoteCache.- Parameters:
key- The Infinispan cache key to remove.
-
wrap
-
wrap
-
getCachedEntities
-