use of io.jans.exception.ConfigurationException in project jans by JanssenProject.
the class ConfigurationFactory method getCorsConfiguration.
@Produces
@ApplicationScoped
public CorsConfiguration getCorsConfiguration() {
try {
if (this.corsConfigurationFilter != null) {
CorsConfiguration corsConfiguration = new CorsConfiguration();
corsConfiguration.parseAndStore(this.corsConfigurationFilter.getCorsEnabled().toString(), this.corsConfigurationFilter.getCorsAllowedOrigins(), this.corsConfigurationFilter.getCorsAllowedMethods(), this.corsConfigurationFilter.getCorsAllowedHeaders(), this.corsConfigurationFilter.getCorsExposedHeaders(), this.corsConfigurationFilter.getCorsSupportCredentials().toString(), Long.toString(this.corsConfigurationFilter.getCorsPreflightMaxAge()), this.corsConfigurationFilter.getCorsRequestDecorate().toString());
log.debug("Initializing CorsConfiguration:{} ", corsConfiguration);
return corsConfiguration;
}
} catch (Exception ex) {
throw new ConfigurationException("Failed to initialize CorsConfiguration" + corsConfigurationFilter);
}
return null;
}
use of io.jans.exception.ConfigurationException in project jans by JanssenProject.
the class ConfigurationFactory method loadCryptoConfigurationSalt.
private void loadCryptoConfigurationSalt() {
try {
FileConfiguration cryptoConfiguration = createFileConfiguration(saltFilePath);
this.cryptoConfigurationSalt = cryptoConfiguration.getString("encodeSalt");
} catch (Exception ex) {
if (log.isErrorEnabled())
log.error("Failed to load configuration from {}", saltFilePath, ex);
throw new ConfigurationException("Failed to load configuration from " + saltFilePath, ex);
}
}
use of io.jans.exception.ConfigurationException in project jans by JanssenProject.
the class ConfigurationFactory method loadCryptoConfigurationSalt.
public void loadCryptoConfigurationSalt() {
try {
FileConfiguration cryptoConfiguration = createFileConfiguration(saltFilePath, true);
this.cryptoConfigurationSalt = cryptoConfiguration.getString("encodeSalt");
} catch (Exception ex) {
if (log.isErrorEnabled())
log.error("Failed to load configuration from {}", saltFilePath, ex);
throw new ConfigurationException("Failed to load configuration from " + saltFilePath, ex);
}
}
use of io.jans.exception.ConfigurationException in project jans by JanssenProject.
the class ClientApiPersistenceEntryManagerFactory method createPersistenceEntryManager.
public final PersistenceEntryManager createPersistenceEntryManager(Properties properties, String persistenceType) {
try {
PersistenceEntryManagerFactory persistenceEntryManagerFactory = this.standalonePersistanceFactoryService.getPersistenceEntryManagerFactory(persistenceType);
if (persistenceEntryManagerFactory.getPersistenceType().equalsIgnoreCase("couchbase")) {
((CouchbaseEntryManagerFactory) persistenceEntryManagerFactory).create();
}
Properties connProps = createConnectionProperties(properties, persistenceEntryManagerFactory.getPersistenceType());
PersistenceEntryManager ret = persistenceEntryManagerFactory.createEntryManager(connProps);
if (ret == null)
throw new RuntimeException("Could not create persistence entry manager");
return ret;
} catch (ConfigurationException e) {
throw new RuntimeException(e.getMessage(), e);
}
}
use of io.jans.exception.ConfigurationException in project jans by JanssenProject.
the class ConfigurationFactory method loadCryptoConfigurationSalt.
public void loadCryptoConfigurationSalt() {
try {
FileConfiguration cryptoConfiguration = createFileConfiguration(saltFilePath, true);
this.cryptoConfigurationSalt = cryptoConfiguration.getString("encodeSalt");
} catch (Exception ex) {
log.error("Failed to load configuration from {}", saltFilePath, ex);
throw new ConfigurationException("Failed to load configuration from " + saltFilePath, ex);
}
}
Aggregations