use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class ConfigurationFactory method loadConfigurationFromDb.
@Override
protected LdapOxTrustConfiguration loadConfigurationFromDb(String... returnAttributes) {
final PersistenceEntryManager persistenceEntryManager = persistenceEntryManagerInstance.get();
final String configurationDn = getConfigurationDn();
try {
final LdapOxTrustConfiguration conf = persistenceEntryManager.find(configurationDn, LdapOxTrustConfiguration.class, returnAttributes);
return conf;
} catch (BasePersistenceException ex) {
log.error("Failed to load configuration from LDAP", ex);
}
return null;
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class OrganizationService method getOxAuthSetting.
public LdapOxAuthConfiguration getOxAuthSetting(String configurationDn) {
LdapOxAuthConfiguration ldapOxAuthConfiguration = null;
try {
configurationDn = configurationDn.replace("ou=oxtrust", "ou=oxauth");
ldapOxAuthConfiguration = persistenceEntryManager.find(LdapOxAuthConfiguration.class, configurationDn);
return ldapOxAuthConfiguration;
} catch (BasePersistenceException ex) {
log.error("Failed to load configuration from LDAP");
}
return null;
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class JsonConfigurationService method loadFido2Configuration.
public DbApplicationConfiguration loadFido2Configuration() {
try {
String configurationDn = configurationFactory.getBaseConfiguration().getString("fido2_ConfigurationEntryDN");
DbApplicationConfiguration conf = persistenceEntryManager.find(DbApplicationConfiguration.class, configurationDn);
return conf;
} catch (BasePersistenceException ex) {
log.error("Failed to load Fido2 configuration from LDAP");
}
return null;
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class CacheRefreshTimer method updateTargetEntriesViaVDS.
private List<String> updateTargetEntriesViaVDS(CacheRefreshConfiguration cacheRefreshConfiguration, LdapServerConnection targetServerConnection, Set<String> changedInums) {
List<String> result = new ArrayList<String>();
PersistenceEntryManager targetPersistenceEntryManager = targetServerConnection.getPersistenceEntryManager();
Filter filter = cacheRefreshService.createObjectClassPresenceFilter();
for (String changedInum : changedInums) {
String baseDn = "action=synchronizecache," + personService.getDnForPerson(changedInum);
try {
targetPersistenceEntryManager.findEntries(baseDn, DummyEntry.class, filter, SearchScope.SUB, null, null, 0, 0, cacheRefreshConfiguration.getLdapSearchSizeLimit());
result.add(changedInum);
log.debug("Updated entry with inum {}", changedInum);
} catch (BasePersistenceException ex) {
log.error("Failed to update entry with inum '{}' using baseDN {}", changedInum, baseDn, ex);
}
}
return result;
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class UserProfileAction method update.
public String update() {
try {
if (appConfiguration.getEnforceEmailUniqueness() && !dataSourceTypeService.isLDAP(personService.getDnForPerson(null))) {
if (!userEmailIsUniqAtEditionTime(this.person.getAttribute("mail"))) {
facesMessages.add(FacesMessage.SEVERITY_ERROR, "#{msgs['UpdatePersonAction.faileUpdateUserMailidExist']} %s", person.getMail());
return OxTrustConstants.RESULT_FAILURE;
}
}
GluuCustomPerson person = this.person;
person.setGluuOptOuts(optOuts.size() == 0 ? null : optOuts);
boolean runScript = externalUpdateUserService.isEnabled();
if (runScript) {
externalUpdateUserService.executeExternalUpdateUserMethods(this.person);
}
personService.updatePerson(this.person);
oxTrustAuditService.audit(this.person.getInum() + " **" + this.person.getDisplayName() + "** PROFILE UPDATED", identity.getUser(), (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest());
if (runScript) {
externalUpdateUserService.executeExternalPostUpdateUserMethods(this.person);
}
} catch (DuplicateEmailException ex) {
log.error("Failed to update profile {}", person.getInum(), ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, ex.getMessage());
return OxTrustConstants.RESULT_FAILURE;
} catch (BasePersistenceException ex) {
log.error("Failed to update profile {}", person.getInum(), ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to update profile '#{userProfileAction.person.displayName}'");
return OxTrustConstants.RESULT_FAILURE;
} catch (Exception ex) {
log.error("Failed to update profile {}", person.getInum(), ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to update profile '#{userProfileAction.person.displayName}'");
return OxTrustConstants.RESULT_FAILURE;
}
facesMessages.add(FacesMessage.SEVERITY_INFO, "Profile '#{userProfileAction.person.displayName}' updated successfully");
return OxTrustConstants.RESULT_SUCCESS;
}
Aggregations