org.keycloak.services

## Class DefaultKeycloakSessionFactory

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

- All Implemented Interfaces:
    KeycloakSessionFactory, ProviderEventManager, ProviderManagerDeployer

      public class DefaultKeycloakSessionFactory
      extends Object
      implements KeycloakSessionFactory, ProviderManagerDeployer

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `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()`
    `List<ProviderFactory>` | `getProviderFactories(Class<? extends Provider> clazz)`
    `<T extends Provider> ProviderFactory<T>` | `getProviderFactory(Class<T> clazz)`
    `<T extends Provider> ProviderFactory<T>` | `getProviderFactory(Class<T> clazz, String id)`
    `long` | `getRoleStorageProviderTimeout()`
    `long` | `getServerStartupTimestamp()`
    `Spi` | `getSpi(Class<? extends Provider> providerClass)`
    `Set<Spi>` | `getSpis()`
    `protected DefaultThemeManagerFactory` | `getThemeManagerFactory()`
    `void` | `init()`
    `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)`

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

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

- - ### 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

  - ### 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`

    - #### getProviderFactories

          public List<ProviderFactory> getProviderFactories(Class<? extends Provider> clazz)

      Specified by:
        `getProviderFactories` in interface `KeycloakSessionFactory`

    - #### 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

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