org.keycloak.services

## Class DefaultKeycloakSessionFactory

- java.lang.Object
- - org.keycloak.services.DefaultKeycloakSessionFactory

- All Implemented Interfaces:
    KeycloakSessionFactory, InvalidationHandler, ProviderEventManager, ProviderManagerDeployer

      public class DefaultKeycloakSessionFactory
      extends Object
      implements KeycloakSessionFactory, ProviderManagerDeployer

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.keycloak.provider.InvalidationHandler

      `InvalidationHandler.InvalidableObjectType, InvalidationHandler.ObjectType`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected ComponentFactoryProviderFactory` | `componentFactoryPF`
    `protected Map<Class<? extends Provider>,Map<String,ProviderFactory>>` | `factoriesMap`
    `protected CopyOnWriteArrayList<ProviderEventListener>` | `listeners`
    `protected Map<Class<? extends Provider>,String>` | `provider`
    `protected long` | `serverStartupTimestamp`
    `protected Set<Spi>` | `spis`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultKeycloakSessionFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `checkProvider()`
    `void` | `close()`
    `KeycloakSession` | `create()`
    `void` | `deploy(ProviderManager pm)`
    `long` | `getClientStorageProviderTimeout()`
    `protected Map<Class<? extends Provider>,Map<String,ProviderFactory>>` | `getFactoriesCopy()`
    `Stream<ProviderFactory>` | `getProviderFactoriesStream(Class<? extends Provider> clazz)` Returns stream of provider factories for the given provider.
    `<T extends Provider> ProviderFactory<T>` | `getProviderFactory(Class<T> clazz)`
    `<T extends Provider> ProviderFactory<T>` | `getProviderFactory(Class<T> clazz, String id)`
    `<T extends Provider> ProviderFactory<T>` | `getProviderFactory(Class<T> clazz, String realmId, String componentId, Function<KeycloakSessionFactory,ComponentModel> modelGetter)`
    `long` | `getRoleStorageProviderTimeout()`
    `long` | `getServerStartupTimestamp()`
    `Spi` | `getSpi(Class<? extends Provider> providerClass)`
    `Set<Spi>` | `getSpis()`
    `protected DefaultThemeManagerFactory` | `getThemeManagerFactory()`
    `void` | `init()`
    `void` | `invalidate(InvalidationHandler.InvalidableObjectType type, Object... ids)` Invalidates intermediate states of the given objects
    `protected boolean` | `isEnabled(ProviderFactory factory, Config.Scope scope)`
    `protected boolean` | `isInternal(ProviderFactory<?> factory)`
    `protected Map<Class<? extends Provider>,Map<String,ProviderFactory>>` | `loadFactories(ProviderManager pm)`
    `void` | `publish(ProviderEvent event)`
    `void` | `register(ProviderEventListener listener)`
    `void` | `undeploy(ProviderManager pm)`
    `void` | `unregister(ProviderEventListener listener)`
    `protected void` | `updateComponentFactoryProviderFactory()`

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

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

    - ### Methods inherited from interface org.keycloak.models.KeycloakSessionFactory

      `getProviderFactories`

- - ### Field Detail

    - #### spis

          protected Set<Spi> spis

    - #### provider

          protected Map<Class<? extends Provider>,String> provider

    - #### factoriesMap

          protected volatile Map<Class<? extends Provider>,Map<String,ProviderFactory>> factoriesMap

    - #### listeners

          protected CopyOnWriteArrayList<ProviderEventListener> listeners

    - #### serverStartupTimestamp

          protected long serverStartupTimestamp

    - #### componentFactoryPF

          protected ComponentFactoryProviderFactory componentFactoryPF

  - ### Constructor Detail

    - #### DefaultKeycloakSessionFactory

          public DefaultKeycloakSessionFactory()

  - ### Method Detail

    - #### register

          public void register(ProviderEventListener listener)

      Specified by:
        `register` in interface `ProviderEventManager`

    - #### unregister

          public void unregister(ProviderEventListener listener)

      Specified by:
        `unregister` in interface `ProviderEventManager`

    - #### publish

          public void publish(ProviderEvent event)

      Specified by:
        `publish` in interface `ProviderEventManager`

    - #### init

          public void init()

    - #### getFactoriesCopy

          protected Map<Class<? extends Provider>,Map<String,ProviderFactory>> getFactoriesCopy()

    - #### deploy

          public void deploy(ProviderManager pm)

      Specified by:
        `deploy` in interface `ProviderManagerDeployer`

    - #### undeploy

          public void undeploy(ProviderManager pm)

      Specified by:
        `undeploy` in interface `ProviderManagerDeployer`

    - #### getThemeManagerFactory

          protected DefaultThemeManagerFactory getThemeManagerFactory()

    - #### checkProvider

          protected void checkProvider()

    - #### loadFactories

          protected Map<Class<? extends Provider>,Map<String,ProviderFactory>> loadFactories(ProviderManager pm)

    - #### isEnabled

          protected boolean isEnabled(ProviderFactory factory,
                                      Config.Scope scope)

    - #### create

          public KeycloakSession create()

      Specified by:
        `create` in interface `KeycloakSessionFactory`

    - #### getSpis

          public Set<Spi> getSpis()

      Specified by:
        `getSpis` in interface `KeycloakSessionFactory`

    - #### getSpi

          public Spi getSpi(Class<? extends Provider> providerClass)

      Specified by:
        `getSpi` in interface `KeycloakSessionFactory`

    - #### getProviderFactory

          public <T extends Provider> ProviderFactory<T> getProviderFactory(Class<T> clazz)

      Specified by:
        `getProviderFactory` in interface `KeycloakSessionFactory`

    - #### getProviderFactory

          public <T extends Provider> ProviderFactory<T> getProviderFactory(Class<T> clazz,
                                                                            String id)

      Specified by:
        `getProviderFactory` in interface `KeycloakSessionFactory`

    - #### getProviderFactory

          public <T extends Provider> ProviderFactory<T> getProviderFactory(Class<T> clazz,
                                                                            String realmId,
                                                                            String componentId,
                                                                            Function<KeycloakSessionFactory,ComponentModel> modelGetter)

      Specified by:
        `getProviderFactory` in interface `KeycloakSessionFactory`

    - #### invalidate

          public void invalidate(InvalidationHandler.InvalidableObjectType type,
                                 Object... ids)

      Description copied from interface: `InvalidationHandler`
      Invalidates intermediate states of the given objects
      Specified by:
        `invalidate` in interface `InvalidationHandler`
      Parameters:
        `type` - Type of the objects to invalidate
        `ids` - Identifiers of the invalidated objects

    - #### getProviderFactoriesStream

          public Stream<ProviderFactory> getProviderFactoriesStream(Class<? extends Provider> clazz)

      Description copied from interface: `KeycloakSessionFactory`
      Returns stream of provider factories for the given provider.
      Specified by:
        `getProviderFactoriesStream` in interface `KeycloakSessionFactory`
      Parameters:
        `clazz` - `Class<? extends Provider>`
      Returns:
        `Stream<ProviderFactory>` Stream of provider factories. Never returns `null`.

    - #### close

          public void close()

      Specified by:
        `close` in interface `KeycloakSessionFactory`

    - #### isInternal

          protected boolean isInternal(ProviderFactory<?> factory)

    - #### getClientStorageProviderTimeout

          public long getClientStorageProviderTimeout()

    - #### getRoleStorageProviderTimeout

          public long getRoleStorageProviderTimeout()

    - #### getServerStartupTimestamp

          public long getServerStartupTimestamp()

      Specified by:
        `getServerStartupTimestamp` in interface `KeycloakSessionFactory`
      Returns:
        timestamp of Keycloak server startup

    - #### updateComponentFactoryProviderFactory

          protected void updateComponentFactoryProviderFactory()

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