Package 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 Description DefaultJpaConnectionProviderFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkJtaEnabled(KeycloakSessionFactory factory)
void
close()
This is called when the server shuts down.JpaConnectionProvider
create(KeycloakSession session)
protected String
detectDialect(Connection connection)
protected void
export(Connection connection, String schema, File databaseUpdateFile, KeycloakSession session, JpaUpdaterProvider updater)
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 initializedprotected void
prepareOperationalInfo(Connection connection)
protected void
startGlobalStats(KeycloakSession session, int globalStatsIntervalSecs)
protected void
update(Connection connection, String schema, KeycloakSession session, JpaUpdaterProvider updater)
-
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
getConfigMetadata, order
-
-
-
-
Method Detail
-
create
public JpaConnectionProvider create(KeycloakSession session)
- Specified by:
create
in interfaceProviderFactory<JpaConnectionProvider>
-
close
public void close()
Description copied from interface:ProviderFactory
This is called when the server shuts down.- Specified by:
close
in interfaceProviderFactory<JpaConnectionProvider>
-
getId
public String getId()
- Specified by:
getId
in interfaceProviderFactory<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 interfaceProviderFactory<JpaConnectionProvider>
-
postInit
public void postInit(KeycloakSessionFactory factory)
Description copied from interface:ProviderFactory
Called after all provider factories have been initialized- Specified by:
postInit
in interfaceProviderFactory<JpaConnectionProvider>
-
checkJtaEnabled
protected void checkJtaEnabled(KeycloakSessionFactory factory)
-
prepareOperationalInfo
protected void prepareOperationalInfo(Connection connection)
-
detectDialect
protected String detectDialect(Connection connection)
-
startGlobalStats
protected void startGlobalStats(KeycloakSession session, int globalStatsIntervalSecs)
-
update
protected void update(Connection connection, String schema, KeycloakSession session, JpaUpdaterProvider updater)
-
export
protected void export(Connection connection, String schema, File databaseUpdateFile, KeycloakSession session, JpaUpdaterProvider updater)
-
getConnection
public Connection getConnection()
- Specified by:
getConnection
in interfaceJpaConnectionProviderFactory
-
getSchema
public String getSchema()
- Specified by:
getSchema
in interfaceJpaConnectionProviderFactory
-
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 interfaceServerInfoAwareProviderFactory
- Returns:
- Map with keys describing value and relevant values itself
-
-