use of io.jans.orm.exception.BasePersistenceException in project jans by JanssenProject.
the class AppInitializer method loadConfiguration.
private GluuConfiguration loadConfiguration(PersistenceEntryManager localPersistenceEntryManager, String... persistenceReturnAttributes) {
String configurationDn = configurationFactory.getBaseDn().getConfiguration();
if (StringHelper.isEmpty(configurationDn)) {
return null;
}
GluuConfiguration configuration = null;
try {
configuration = localPersistenceEntryManager.find(configurationDn, GluuConfiguration.class, persistenceReturnAttributes);
} catch (BasePersistenceException ex) {
log.error("Failed to load global configuration entry from Ldap", ex);
return null;
}
return configuration;
}
use of io.jans.orm.exception.BasePersistenceException in project jans by JanssenProject.
the class ConfigurationFactory method loadConfigurationFromDb.
private <T> T loadConfigurationFromDb(String dn, T obj, String... returnAttributes) {
log.debug("loadConfigurationFromDb dn:{}, clazz:{}, returnAttributes:{}", dn, obj, returnAttributes);
final PersistenceEntryManager persistenceEntryManager = persistenceEntryManagerInstance.get();
try {
return (T) persistenceEntryManager.find(dn, obj.getClass(), returnAttributes);
} catch (BasePersistenceException ex) {
log.error(ex.getMessage());
return null;
}
}
use of io.jans.orm.exception.BasePersistenceException in project jans by JanssenProject.
the class ConfigurationFactory method loadConfigurationFromLdap.
private Conf loadConfigurationFromLdap(String... returnAttributes) {
final PersistenceEntryManager persistenceEntryManager = persistenceEntryManagerInstance.get();
final String dn = getConfigurationDn();
try {
final Conf conf = persistenceEntryManager.find(dn, Conf.class, returnAttributes);
return conf;
} catch (BasePersistenceException ex) {
log.error(ex.getMessage());
}
return null;
}
use of io.jans.orm.exception.BasePersistenceException in project jans by JanssenProject.
the class ConfigurationFactory method loadConfigurationFromLdap.
private Conf loadConfigurationFromLdap(String... returnAttributes) {
final PersistenceEntryManager persistenceEntryManager = persistenceEntryManagerInstance.get();
final String dn = this.baseConfiguration.getString("fido2_ConfigurationEntryDN");
try {
final Conf conf = persistenceEntryManager.find(dn, Conf.class, returnAttributes);
return conf;
} catch (BasePersistenceException ex) {
log.error(ex.getMessage());
}
return null;
}
use of io.jans.orm.exception.BasePersistenceException in project jans by JanssenProject.
the class ConfigurationFactory method loadConfigurationFromPersistence.
private io.jans.as.model.config.Conf loadConfigurationFromPersistence(String... returnAttributes) {
final PersistenceEntryManager ldapManager = persistenceEntryManagerInstance.get();
final String dn = this.baseConfiguration.getString(SERVER_KEY_OF_CONFIGURATION_ENTRY);
try {
return ldapManager.find(dn, io.jans.as.model.config.Conf.class, returnAttributes);
} catch (BasePersistenceException ex) {
if (!dn.contains("_test")) {
ex.printStackTrace();
}
log.error(ex.getMessage());
}
return null;
}
Aggregations