Class RemoteChangeLogTransaction<K,V,T extends Updater<K,V>,R extends ConditionalRemover<K,V>>

java.lang.Object
org.keycloak.models.AbstractKeycloakTransaction
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 the Updater implementation.
All Implemented Interfaces:
KeycloakTransaction
Direct Known Subclasses:
AuthenticationSessionChangeLogTransaction, ClientSessionChangeLogTransaction, LoginFailureChangeLogTransaction, UserSessionChangeLogTransaction

public class RemoteChangeLogTransaction<K,V,T extends Updater<K,V>,R extends ConditionalRemover<K,V>> extends AbstractKeycloakTransaction
A KeycloakTransaction implementation that keeps track of changes made to entities stored in a Infinispan cache.
  • Method Details

    • commitImpl

      protected void commitImpl()
      Specified by:
      commitImpl in class AbstractKeycloakTransaction
    • rollbackImpl

      protected void rollbackImpl()
      Specified by:
      rollbackImpl in class AbstractKeycloakTransaction
    • commitAsync

      public void commitAsync(org.infinispan.commons.util.concurrent.AggregateCompletionStage<Void> stage)
    • getCache

      public org.infinispan.client.hotrod.RemoteCache<K,V> getCache()
      Returns:
      The RemoteCache tracked by the transaction.
    • get

      public T get(K key)
      Fetches the value associated to the key.

      It fetches the value from the RemoteCache if a copy does not exist in the transaction.

      Parameters:
      key - The Infinispan cache key to fetch.
      Returns:
      The Updater to track further changes of the Infinispan cache value.
    • getAsync

      public CompletionStage<T> getAsync(K key)
      Nonblocking alternative of get(Object)
      Parameters:
      key - The Infinispan cache key to fetch.
      Returns:
      The Updater to track further changes of the Infinispan cache value.
    • create

      public T create(K key, V entity)
      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 Updater to track further changes of the Infinispan cache value.
    • remove

      public void remove(K key)
      Removes the key from the RemoteCache.
      Parameters:
      key - The Infinispan cache key to remove.
    • wrap

      public T wrap(Map.Entry<K,org.infinispan.client.hotrod.MetadataValue<V>> entry)
    • wrap

      public T wrap(K key, V value, long version)
    • getCachedEntities

      protected Map<K,T> getCachedEntities()