Search in sources :

Example 1 with ConfigurationException

use of org.xdi.exception.ConfigurationException in project oxAuth by GluuFederation.

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 {}", ex, saltFilePath);
        throw new ConfigurationException("Failed to load configuration from " + saltFilePath, ex);
    }
}
Also used : FileConfiguration(org.xdi.util.properties.FileConfiguration) ConfigurationException(org.xdi.exception.ConfigurationException) ConfigurationException(org.xdi.exception.ConfigurationException) JsonMappingException(org.codehaus.jackson.map.JsonMappingException) LdapMappingException(org.gluu.site.ldap.persistence.exception.LdapMappingException) IOException(java.io.IOException) JsonParseException(org.codehaus.jackson.JsonParseException)

Example 2 with ConfigurationException

use of org.xdi.exception.ConfigurationException in project oxTrust by GluuFederation.

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 {}", ex, this.saltFilePath);
        throw new ConfigurationException("Failed to load configuration from " + this.saltFilePath, ex);
    }
}
Also used : FileConfiguration(org.xdi.util.properties.FileConfiguration) ConfigurationException(org.xdi.exception.ConfigurationException) ConfigurationException(org.xdi.exception.ConfigurationException) LdapMappingException(org.gluu.site.ldap.persistence.exception.LdapMappingException)

Example 3 with ConfigurationException

use of org.xdi.exception.ConfigurationException in project oxTrust by GluuFederation.

the class ConfigurationFactory method createFileConfiguration.

private FileConfiguration createFileConfiguration(String fileName, boolean isMandatory) {
    try {
        FileConfiguration fileConfiguration = new FileConfiguration(fileName);
        if (fileConfiguration.isLoaded()) {
            log.debug("########## fileName = " + fileConfiguration.getFileName());
            log.debug("########## oxtrust_ConfigurationEntryDN = " + fileConfiguration.getString("oxtrust_ConfigurationEntryDN"));
            return fileConfiguration;
        }
    } catch (Exception ex) {
        if (isMandatory) {
            log.error("Failed to load configuration from {}", ex, fileName);
            throw new ConfigurationException("Failed to load configuration from " + fileName, ex);
        }
    }
    return null;
}
Also used : FileConfiguration(org.xdi.util.properties.FileConfiguration) ConfigurationException(org.xdi.exception.ConfigurationException) ConfigurationException(org.xdi.exception.ConfigurationException) LdapMappingException(org.gluu.site.ldap.persistence.exception.LdapMappingException)

Aggregations

LdapMappingException (org.gluu.site.ldap.persistence.exception.LdapMappingException)3 ConfigurationException (org.xdi.exception.ConfigurationException)3 FileConfiguration (org.xdi.util.properties.FileConfiguration)3 IOException (java.io.IOException)1 JsonParseException (org.codehaus.jackson.JsonParseException)1 JsonMappingException (org.codehaus.jackson.map.JsonMappingException)1