Class InfinispanKeycloakTransaction

java.lang.Object
org.keycloak.models.sessions.infinispan.InfinispanKeycloakTransaction
All Implemented Interfaces:
NonBlockingTransaction

public class InfinispanKeycloakTransaction extends Object implements NonBlockingTransaction
Author:
Stian Thorgersen
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    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
    replace(org.infinispan.Cache<K,V> cache, K key, V value, long lifespan, TimeUnit lifespanUnit)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 the stage.

      Any blocking operation should be consumed by the databaseUpdates. It will be executed at a later instant.

      Specified by:
      asyncCommit in interface NonBlockingTransaction
      Parameters:
      stage - The AggregateCompletionStage to collect the CompletionStage.
      databaseUpdates - The Consumer 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 the stage.

      Specified by:
      asyncRollback in interface NonBlockingTransaction
      Parameters:
      stage - The AggregateCompletionStage to collect the CompletionStage.
    • 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)