KEYCLOAK-1783
This commit is contained in:
parent
41275b0e91
commit
ad497a66cd
2 changed files with 30 additions and 19 deletions
|
@ -45,6 +45,11 @@ public class ExportImportManager {
|
||||||
logger.info("Export finished successfully");
|
logger.info("Export finished successfully");
|
||||||
} else {
|
} else {
|
||||||
ImportProvider importProvider = session.getProvider(ImportProvider.class, exportImportProviderId);
|
ImportProvider importProvider = session.getProvider(ImportProvider.class, exportImportProviderId);
|
||||||
|
|
||||||
|
if (importProvider == null) {
|
||||||
|
logger.errorf("Invalid Import Provider %s", exportImportProviderId);
|
||||||
|
} else {
|
||||||
|
|
||||||
Strategy strategy = ExportImportConfig.getStrategy();
|
Strategy strategy = ExportImportConfig.getStrategy();
|
||||||
if (realmName == null) {
|
if (realmName == null) {
|
||||||
logger.infof("Full model import requested. Strategy: %s", strategy.toString());
|
logger.infof("Full model import requested. Strategy: %s", strategy.toString());
|
||||||
|
@ -67,6 +72,7 @@ public class ExportImportManager {
|
||||||
}
|
}
|
||||||
logger.info("Import finished successfully");
|
logger.info("Import finished successfully");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} catch (Throwable ioe) {
|
} catch (Throwable ioe) {
|
||||||
logger.error("Error during export/import", ioe);
|
logger.error("Error during export/import", ioe);
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package org.keycloak.services;
|
package org.keycloak.services;
|
||||||
|
|
||||||
|
import org.jboss.logging.Logger;
|
||||||
import org.jboss.resteasy.spi.HttpRequest;
|
import org.jboss.resteasy.spi.HttpRequest;
|
||||||
import org.jboss.resteasy.spi.ResteasyProviderFactory;
|
import org.jboss.resteasy.spi.ResteasyProviderFactory;
|
||||||
import org.keycloak.models.KeycloakContext;
|
import org.keycloak.models.KeycloakContext;
|
||||||
|
@ -16,6 +17,7 @@ import org.keycloak.provider.Provider;
|
||||||
import org.keycloak.provider.ProviderFactory;
|
import org.keycloak.provider.ProviderFactory;
|
||||||
|
|
||||||
import javax.ws.rs.core.UriInfo;
|
import javax.ws.rs.core.UriInfo;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
|
@ -38,6 +40,8 @@ public class DefaultKeycloakSession implements KeycloakSession {
|
||||||
private UserFederationManager federationManager;
|
private UserFederationManager federationManager;
|
||||||
private KeycloakContext context;
|
private KeycloakContext context;
|
||||||
|
|
||||||
|
private static final Logger logger = Logger.getLogger(DefaultKeycloakSession.class);
|
||||||
|
|
||||||
public DefaultKeycloakSession(DefaultKeycloakSessionFactory factory) {
|
public DefaultKeycloakSession(DefaultKeycloakSessionFactory factory) {
|
||||||
this.factory = factory;
|
this.factory = factory;
|
||||||
this.transactionManager = new DefaultKeycloakTransactionManager();
|
this.transactionManager = new DefaultKeycloakTransactionManager();
|
||||||
|
@ -108,6 +112,7 @@ public class DefaultKeycloakSession implements KeycloakSession {
|
||||||
T provider = (T) providers.get(hash);
|
T provider = (T) providers.get(hash);
|
||||||
if (provider == null) {
|
if (provider == null) {
|
||||||
ProviderFactory<T> providerFactory = factory.getProviderFactory(clazz, id);
|
ProviderFactory<T> providerFactory = factory.getProviderFactory(clazz, id);
|
||||||
|
|
||||||
if (providerFactory != null) {
|
if (providerFactory != null) {
|
||||||
provider = providerFactory.create(this);
|
provider = providerFactory.create(this);
|
||||||
providers.put(hash, provider);
|
providers.put(hash, provider);
|
||||||
|
|
Loading…
Reference in a new issue