Search in sources :

Example 21 with BasePersistenceException

use of org.gluu.persist.exception.BasePersistenceException in project oxAuth by GluuFederation.

the class ConfigurationFactory method loadConfigurationFromLdap.

private Conf loadConfigurationFromLdap(String... returnAttributes) {
    final PersistenceEntryManager ldapManager = persistenceEntryManagerInstance.get();
    final String dn = this.baseConfiguration.getString("oxauth_ConfigurationEntryDN");
    try {
        final Conf conf = ldapManager.find(dn, Conf.class, returnAttributes);
        return conf;
    } catch (BasePersistenceException ex) {
        ex.printStackTrace();
        log.error(ex.getMessage());
    }
    return null;
}
Also used : PersistenceEntryManager(org.gluu.persist.PersistenceEntryManager) BasePersistenceException(org.gluu.persist.exception.BasePersistenceException)

Example 22 with BasePersistenceException

use of org.gluu.persist.exception.BasePersistenceException in project oxAuth by GluuFederation.

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;
}
Also used : BasePersistenceException(org.gluu.persist.exception.BasePersistenceException) GluuConfiguration(org.oxauth.persistence.model.configuration.GluuConfiguration)

Aggregations

BasePersistenceException (org.gluu.persist.exception.BasePersistenceException)22 ArrayList (java.util.ArrayList)4 PersistenceEntryManager (org.gluu.persist.PersistenceEntryManager)4 GluuConfiguration (org.gluu.oxtrust.model.GluuConfiguration)3 OxAuthClient (org.gluu.oxtrust.model.OxAuthClient)3 LdapOxAuthConfiguration (org.gluu.config.oxtrust.LdapOxAuthConfiguration)2 SelectableEntity (org.gluu.model.SelectableEntity)2 CustomScript (org.gluu.model.custom.script.model.CustomScript)2 Scope (org.oxauth.persistence.model.Scope)2 IOException (java.io.IOException)1 Date (java.util.Date)1 WebKeysSettings (org.gluu.config.oxauth.WebKeysSettings)1 DbApplicationConfiguration (org.gluu.config.oxtrust.DbApplicationConfiguration)1 LdapOxTrustConfiguration (org.gluu.config.oxtrust.LdapOxTrustConfiguration)1 DisplayNameEntry (org.gluu.model.DisplayNameEntry)1 UmaResource (org.gluu.oxauth.model.uma.persistence.UmaResource)1 DuplicateEmailException (org.gluu.oxtrust.exception.DuplicateEmailException)1 GluuInumMap (org.gluu.oxtrust.ldap.cache.model.GluuInumMap)1 GluuSimplePerson (org.gluu.oxtrust.ldap.cache.model.GluuSimplePerson)1 GluuCustomPerson (org.gluu.oxtrust.model.GluuCustomPerson)1