use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class ManageCertificateAction method updateTrustCertificates.
private boolean updateTrustCertificates() {
try {
GluuConfiguration tmpConfiguration = configurationService.getConfiguration();
TrustStoreConfiguration currTrustStoreConfiguration = tmpConfiguration.getTrustStoreConfiguration();
List<TrustStoreCertificate> currTrustStoreCertificates = tmpConfiguration.getTrustStoreCertificates();
if (currTrustStoreCertificates == null) {
currTrustStoreCertificates = new ArrayList<TrustStoreCertificate>(0);
}
if (!trustStoreConfiguration.equals(currTrustStoreConfiguration) || !trustStoreCertificates.equals(currTrustStoreCertificates)) {
this.wereAnyChanges = true;
}
tmpConfiguration.setTrustStoreConfiguration(trustStoreConfiguration);
if (trustStoreCertificates.size() == 0) {
tmpConfiguration.setTrustStoreCertificates(null);
} else {
tmpConfiguration.setTrustStoreCertificates(trustStoreCertificates);
}
configurationService.updateConfiguration(tmpConfiguration);
} catch (BasePersistenceException ex) {
log.error("Failed to update configuration configuration", ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to update configuration");
return false;
}
return true;
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class UpdateGroupAction method add.
public String add() throws Exception {
if (this.group != null) {
return OxTrustConstants.RESULT_SUCCESS;
}
this.update = false;
this.group = new GluuGroup();
this.group.setOwner(identity.getUser().getDn());
this.group.setOrganization(organizationService.getOrganization().getDn());
this.group.setStatus(GluuStatus.ACTIVE);
try {
this.members = getMemberDisplayNameEntiries();
} catch (BasePersistenceException ex) {
log.error("Failed to prepare lists", ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to add new group");
conversationService.endConversation();
return OxTrustConstants.RESULT_FAILURE;
}
return OxTrustConstants.RESULT_SUCCESS;
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class UpdateScopeAction method add.
public String add() throws Exception {
if (this.scope != null) {
return OxTrustConstants.RESULT_SUCCESS;
}
this.update = false;
this.scope = new Scope();
this.scope.setScopeType(ScopeType.OAUTH);
try {
if (this.scope.getOxAuthClaims() != null && this.scope.getOxAuthClaims().size() > 0) {
this.claims = getClaimDisplayNameEntiries();
} else {
this.claims = new ArrayList<DisplayNameEntry>();
}
} catch (BasePersistenceException ex) {
log.error("Failed to load scopes", ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to add new scope");
conversationService.endConversation();
return OxTrustConstants.RESULT_FAILURE;
}
this.dynamicScripts = getInitialDynamicScripts();
fillAvailableDynScript();
this.oxAttributesJson = getScopeAttributesJson();
return OxTrustConstants.RESULT_SUCCESS;
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class UpdateOrganizationAction method initOxAuthSetting.
private void initOxAuthSetting() {
String configurationDn = configurationFactory.getConfigurationDn();
try {
ldapOxAuthConfiguration = organizationService.getOxAuthSetting(configurationDn);
this.webKeysSettings = ldapOxAuthConfiguration.getOxWebKeysSettings();
if (webKeysSettings == null) {
webKeysSettings = new WebKeysSettings();
}
} catch (BasePersistenceException ex) {
log.error("Failed to load configuration from LDAP");
}
}
use of org.gluu.persist.exception.BasePersistenceException in project oxTrust by GluuFederation.
the class JsonConfigurationService method loadOxAuthConfig.
private LdapOxAuthConfiguration loadOxAuthConfig(String configurationDn) {
try {
configurationDn = configurationDn.replace("ou=oxtrust", "ou=oxauth");
LdapOxAuthConfiguration conf = persistenceEntryManager.find(LdapOxAuthConfiguration.class, configurationDn);
return conf;
} catch (BasePersistenceException ex) {
log.error("Failed to load configuration from LDAP");
}
return null;
}
Aggregations