org.keycloak.connections.infinispan

## Class DefaultInfinispanConnectionProviderFactory

- java.lang.Object
- - org.keycloak.connections.infinispan.DefaultInfinispanConnectionProviderFactory

- All Implemented Interfaces:
    InfinispanConnectionProviderFactory, ProviderFactory<InfinispanConnectionProvider>

      public class DefaultInfinispanConnectionProviderFactory
      extends Object
      implements InfinispanConnectionProviderFactory

  Author:
    Stian Thorgersen

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected org.infinispan.manager.EmbeddedCacheManager` | `cacheManager`
    `protected Config.Scope` | `config`
    `protected boolean` | `containerManaged`
    `static org.infinispan.commons.time.TimeService` | `KEYCLOAK_TIME_SERVICE`
    `protected static org.jboss.logging.Logger` | `logger`
    `protected RemoteCacheProvider` | `remoteCacheProvider`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultInfinispanConnectionProviderFactory()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` This is called when the server shuts down.
    `protected void` | `configureTransport(org.infinispan.configuration.global.GlobalConfigurationBuilder gcb, String nodeName, String siteName, String jgroupsUdpMcastAddr)`
    `InfinispanConnectionProvider` | `create(KeycloakSession session)`
    `String` | `getId()`
    `protected org.infinispan.configuration.cache.Configuration` | `getKeysCacheConfig()`
    `void` | `init(Config.Scope config)` Only called once when the factory is first created.
    `protected void` | `initContainerManaged(org.infinispan.manager.EmbeddedCacheManager cacheManager)`
    `protected void` | `initEmbedded()`
    `protected void` | `lazyInit()`
    `void` | `postInit(KeycloakSessionFactory factory)` Called after all provider factories have been initialized
    `static Runnable` | `setTimeServiceToKeycloakTime(org.infinispan.manager.EmbeddedCacheManager cacheManager)` Replaces the `TimeService` in infinispan with the one that respects Keycloak `Time`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.keycloak.provider.ProviderFactory

      `order`

- - ### Field Detail

    - #### logger

          protected static final org.jboss.logging.Logger logger

    - #### config

          protected Config.Scope config

    - #### cacheManager

          protected org.infinispan.manager.EmbeddedCacheManager cacheManager

    - #### remoteCacheProvider

          protected RemoteCacheProvider remoteCacheProvider

    - #### containerManaged

          protected boolean containerManaged

    - #### KEYCLOAK_TIME_SERVICE

          public static final org.infinispan.commons.time.TimeService KEYCLOAK_TIME_SERVICE

  - ### Constructor Detail

    - #### DefaultInfinispanConnectionProviderFactory

          public DefaultInfinispanConnectionProviderFactory()

  - ### Method Detail

    - #### create

          public InfinispanConnectionProvider create(KeycloakSession session)

      Specified by:
        `create` in interface `ProviderFactory<InfinispanConnectionProvider>`

    - #### close

          public void close()

      Description copied from interface: `ProviderFactory`
      This is called when the server shuts down.
      Specified by:
        `close` in interface `ProviderFactory<InfinispanConnectionProvider>`

    - #### getId

          public String getId()

      Specified by:
        `getId` in interface `ProviderFactory<InfinispanConnectionProvider>`

    - #### init

          public void init(Config.Scope config)

      Description copied from interface: `ProviderFactory`
      Only called once when the factory is first created. This config is pulled from keycloak_server.json
      Specified by:
        `init` in interface `ProviderFactory<InfinispanConnectionProvider>`

    - #### postInit

          public void postInit(KeycloakSessionFactory factory)

      Description copied from interface: `ProviderFactory`
      Called after all provider factories have been initialized
      Specified by:
        `postInit` in interface `ProviderFactory<InfinispanConnectionProvider>`

    - #### lazyInit

          protected void lazyInit()

    - #### initContainerManaged

          protected void initContainerManaged(org.infinispan.manager.EmbeddedCacheManager cacheManager)

    - #### initEmbedded

          protected void initEmbedded()

    - #### setTimeServiceToKeycloakTime

          public static Runnable setTimeServiceToKeycloakTime(org.infinispan.manager.EmbeddedCacheManager cacheManager)

      Replaces the `TimeService` in infinispan with the one that respects Keycloak `Time`.
      Parameters:
        `cacheManager` -
      Returns:
        Runnable to revert replacement of the infinispan time service

    - #### getKeysCacheConfig

          protected org.infinispan.configuration.cache.Configuration getKeysCacheConfig()

    - #### configureTransport

          protected void configureTransport(org.infinispan.configuration.global.GlobalConfigurationBuilder gcb,
                                            String nodeName,
                                            String siteName,
                                            String jgroupsUdpMcastAddr)

Copyright © 2021 JBoss by Red Hat. All rights reserved.