use of org.gluu.oxauth.model.crypto.AbstractCryptoProvider in project oxAuth by GluuFederation.
the class ConfigurationFactory method destroyCryptoProviderInstance.
private void destroyCryptoProviderInstance() {
log.trace("Destroyed crypto provider instance.");
AbstractCryptoProvider abstractCryptoProvider = abstractCryptoProviderInstance.get();
abstractCryptoProviderInstance.destroy(abstractCryptoProvider);
CryptoProviderFactory.reset();
}
use of org.gluu.oxauth.model.crypto.AbstractCryptoProvider in project oxAuth by GluuFederation.
the class ConfigurationFactory method createFromLdap.
private boolean createFromLdap(boolean recoverFromFiles) {
log.info("Loading configuration from '{}' DB...", baseConfiguration.getString("persistence.type"));
try {
final Conf c = loadConfigurationFromLdap();
if (c != null) {
init(c);
// Destroy old configuration
if (this.loaded) {
destroy(AppConfiguration.class);
destroy(StaticConfiguration.class);
destroy(WebKeysConfiguration.class);
destroy(ErrorResponseFactory.class);
}
this.loaded = true;
configurationUpdateEvent.select(ConfigurationUpdate.Literal.INSTANCE).fire(conf);
destroyCryptoProviderInstance();
AbstractCryptoProvider newAbstractCryptoProvider = abstractCryptoProviderInstance.get();
cryptoProviderEvent.select(CryptoProviderEvent.Literal.INSTANCE).fire(newAbstractCryptoProvider);
return true;
}
} catch (Exception ex) {
log.error(ex.getMessage(), ex);
}
if (recoverFromFiles) {
log.info("Unable to find configuration in LDAP, try to load configuration from file system... ");
if (createFromFile()) {
this.loadedFromLdap = false;
return true;
}
}
return false;
}
Aggregations