org.keycloak.connections.jpa

## Class DefaultJpaConnectionProviderFactory

- java.lang.Object
- - org.keycloak.connections.jpa.DefaultJpaConnectionProviderFactory

- All Implemented Interfaces:
    JpaConnectionProviderFactory, ProviderFactory<JpaConnectionProvider>, ServerInfoAwareProviderFactory

      public class DefaultJpaConnectionProviderFactory
      extends Object
      implements JpaConnectionProviderFactory, ServerInfoAwareProviderFactory

  Author:
    Stian Thorgersen

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultJpaConnectionProviderFactory()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` This is called when the server shuts down.
    `JpaConnectionProvider` | `create(KeycloakSession session)`
    `protected String` | `detectDialect(Connection connection)`
    `Connection` | `getConnection()`
    `String` | `getId()`
    `Map<String,String>` | `getOperationalInfo()` Return actual info about the provider.
    `String` | `getSchema()`
    `void` | `init(Config.Scope config)` Only called once when the factory is first created.
    `void` | `postInit(KeycloakSessionFactory factory)` Called after all provider factories have been initialized
    `protected void` | `prepareOperationalInfo(Connection connection)`
    `protected void` | `startGlobalStats(KeycloakSession session, int globalStatsIntervalSecs)`
    `protected void` | `updateOrValidateDB(String databaseSchema, Connection connection, JpaUpdaterProvider updater, String schema)`

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

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

- - ### Constructor Detail

    - #### DefaultJpaConnectionProviderFactory

          public DefaultJpaConnectionProviderFactory()

  - ### Method Detail

    - #### create

          public JpaConnectionProvider create(KeycloakSession session)

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

    - #### close

          public void close()

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

    - #### getId

          public String getId()

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

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

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

    - #### prepareOperationalInfo

          protected void prepareOperationalInfo(Connection connection)

    - #### detectDialect

          protected String detectDialect(Connection connection)

    - #### startGlobalStats

          protected void startGlobalStats(KeycloakSession session,
                                          int globalStatsIntervalSecs)

    - #### updateOrValidateDB

          protected void updateOrValidateDB(String databaseSchema,
                                            Connection connection,
                                            JpaUpdaterProvider updater,
                                            String schema)

    - #### getConnection

          public Connection getConnection()

      Specified by:
        `getConnection` in interface `JpaConnectionProviderFactory`

    - #### getSchema

          public String getSchema()

      Specified by:
        `getSchema` in interface `JpaConnectionProviderFactory`

    - #### getOperationalInfo

          public Map<String,String> getOperationalInfo()

      Description copied from interface: `ServerInfoAwareProviderFactory`
      Return actual info about the provider. This info contains informations about providers configuration and operational conditions (eg. errors in connection to remote systems etc) which is shown on "Server Info" page then.
      Specified by:
        `getOperationalInfo` in interface `ServerInfoAwareProviderFactory`
      Returns:
        Map with keys describing value and relevant values itself

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