use of org.keycloak.exportimport.ExportImportManager in project keycloak by keycloak.
the class QuarkusJpaConnectionProviderFactory method initSchema.
private void initSchema(KeycloakSession session) {
ExportImportManager exportImportManager = new ExportImportManager(session);
/*
* Migrate model is executed just in case following providers are "jpa".
* In Map Storage, there is an assumption that migrateModel is not needed.
*/
if ((Config.getProvider("realm") == null || "jpa".equals(Config.getProvider("realm"))) && (Config.getProvider("client") == null || "jpa".equals(Config.getProvider("client"))) && (Config.getProvider("clientScope") == null || "jpa".equals(Config.getProvider("clientScope")))) {
logger.debug("Calling migrateModel");
migrateModel(session);
}
DBLockManager dbLockManager = new DBLockManager(session);
dbLockManager.checkForcedUnlock();
DBLockProvider dbLock = dbLockManager.getDBLock();
dbLock.waitForLock(DBLockProvider.Namespace.KEYCLOAK_BOOT);
try {
createMasterRealm(exportImportManager);
} finally {
dbLock.releaseLock();
}
if (exportImportManager.isRunExport()) {
exportImportManager.runExport();
Quarkus.asyncExit();
}
}
Aggregations