Record Class RemoteInfinispanConnectionProvider

java.lang.Object
java.lang.Record
org.keycloak.connections.infinispan.remote.RemoteInfinispanConnectionProvider
All Implemented Interfaces:
InfinispanConnectionProvider, Provider

public record RemoteInfinispanConnectionProvider(org.infinispan.manager.EmbeddedCacheManager embeddedCacheManager, org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager, TopologyInfo topologyInfo) extends Record implements InfinispanConnectionProvider
  • Constructor Details

    • RemoteInfinispanConnectionProvider

      public RemoteInfinispanConnectionProvider(org.infinispan.manager.EmbeddedCacheManager embeddedCacheManager, org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager, TopologyInfo topologyInfo)
      Creates an instance of a RemoteInfinispanConnectionProvider record class.
      Parameters:
      embeddedCacheManager - the value for the embeddedCacheManager record component
      remoteCacheManager - the value for the remoteCacheManager record component
      topologyInfo - the value for the topologyInfo record component
  • Method Details

    • getCache

      public <K, V> org.infinispan.Cache<K,V> getCache(String name, boolean createIfAbsent)
      Description copied from interface: InfinispanConnectionProvider
      Provides an instance if Infinispan cache by name
      Specified by:
      getCache in interface InfinispanConnectionProvider
      Type Parameters:
      K - key type
      V - value type
      Parameters:
      name - name of the requested cache
      createIfAbsent - if true the connection provider will create the requested cache on method call if it does not exist
      Returns:
      return a cache instance
    • getRemoteCache

      public <K, V> org.infinispan.client.hotrod.RemoteCache<K,V> getRemoteCache(String name)
      Description copied from interface: InfinispanConnectionProvider
      Get remote cache of given name. Could just retrieve the remote cache from the remoteStore configured in given infinispan cache and/or alternatively return the secured remoteCache (remoteCache corresponding to secured hotrod endpoint)
      Specified by:
      getRemoteCache in interface InfinispanConnectionProvider
    • getTopologyInfo

      public TopologyInfo getTopologyInfo()
      Specified by:
      getTopologyInfo in interface InfinispanConnectionProvider
      Returns:
      Information about cluster topology
    • migrateToProtoStream

      public CompletionStage<Void> migrateToProtoStream()
      Description copied from interface: InfinispanConnectionProvider
      Migrates the JBoss Marshalling encoding to Infinispan ProtoStream
      Specified by:
      migrateToProtoStream in interface InfinispanConnectionProvider
      Returns:
      A CompletionStage to signal when the operator is completed.
    • getScheduledExecutor

      public ScheduledExecutorService getScheduledExecutor()
      Specified by:
      getScheduledExecutor in interface InfinispanConnectionProvider
      Returns:
      The Infinispan ScheduledExecutorService. Long or blocking operations must not be executed directly.
    • getBlockingManager

      public org.infinispan.util.concurrent.BlockingManager getBlockingManager()
      Description copied from interface: InfinispanConnectionProvider
      Returns the Infinispan BlockingManager.

      The BlockingManager should be used to execute blocking operation like disk I/O. It offloads the task to the Infinispan blocking thread pool.

      Specified by:
      getBlockingManager in interface InfinispanConnectionProvider
      Returns:
      The Infinispan BlockingManager.
    • close

      public void close()
      Specified by:
      close in interface Provider
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • embeddedCacheManager

      public org.infinispan.manager.EmbeddedCacheManager embeddedCacheManager()
      Returns the value of the embeddedCacheManager record component.
      Returns:
      the value of the embeddedCacheManager record component
    • remoteCacheManager

      public org.infinispan.client.hotrod.RemoteCacheManager remoteCacheManager()
      Returns the value of the remoteCacheManager record component.
      Returns:
      the value of the remoteCacheManager record component
    • topologyInfo

      public TopologyInfo topologyInfo()
      Returns the value of the topologyInfo record component.
      Returns:
      the value of the topologyInfo record component