Skip to content

Commit

Permalink
Fix compilation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
yurem committed Sep 25, 2018
1 parent 95812ea commit e12f618
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 33 deletions.
Expand Up @@ -30,7 +30,6 @@
import org.gluu.site.ldap.persistence.annotation.LdapObjectClass;
import org.slf4j.Logger;
import org.xdi.model.GluuStatus;
import org.xdi.ldap.model.InumEntry;
import org.xdi.service.cdi.util.CdiUtil;
import javax.xml.bind.annotation.XmlTransient;
import org.codehaus.jackson.annotate.JsonIgnore;
Expand Down
Expand Up @@ -34,8 +34,8 @@
import org.gluu.oxtrust.security.Identity;
import org.gluu.oxtrust.service.PasswordResetService;
import org.gluu.oxtrust.util.OxTrustConstants;
import org.gluu.site.ldap.persistence.LdapEntryManager;
import org.gluu.site.ldap.persistence.exception.EntryPersistenceException;
import org.gluu.persist.PersistenceEntryManager;
import org.gluu.persist.exception.EntryPersistenceException;
import org.slf4j.Logger;
import org.xdi.config.oxtrust.AppConfiguration;
import org.xdi.util.StringHelper;
Expand All @@ -53,7 +53,7 @@ public class PasswordResetAction implements Serializable {
private Logger log;

@Inject
private LdapEntryManager ldapEntryManager;
private PersistenceEntryManager ldapEntryManager;

@Inject
private FacesMessages facesMessages;
Expand Down
Expand Up @@ -42,7 +42,7 @@
import org.gluu.oxtrust.security.Identity;
import org.gluu.oxtrust.service.PasswordGenerator;
import org.gluu.oxtrust.util.OxTrustConstants;
import org.gluu.site.ldap.persistence.exception.LdapMappingException;
import org.gluu.persist.exception.BasePersistenceException;
import org.slf4j.Logger;
import org.xdi.config.oxtrust.AppConfiguration;
import org.xdi.model.DisplayNameEntry;
Expand Down Expand Up @@ -217,7 +217,7 @@ public String update() throws Exception {
log.debug("inum : " + inum);
this.client = clientService.getClientByInum(inum);
previousClientExpirationDate = this.client.getClientSecretExpiresAt();
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to find client {}", inum, ex);
}

Expand Down Expand Up @@ -323,7 +323,7 @@ public String save() throws Exception {
"OPENID CLIENT " + this.client.getInum() + " **" + this.client.getDisplayName() + "** UPDATED",
identity.getUser(),
(HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest());
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {

log.error("Failed to update client {}", this.inum, ex);

Expand Down Expand Up @@ -351,7 +351,7 @@ public String save() throws Exception {
"OPENID CLIENT " + this.client.getInum() + " **" + this.client.getDisplayName() + "** ADDED ",
identity.getUser(),
(HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest());
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to add new client {}", this.inum, ex);

facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to add new client");
Expand Down
Expand Up @@ -50,13 +50,13 @@
import org.gluu.oxtrust.service.external.ExternalUpdateUserService;
import org.gluu.oxtrust.util.OxTrustConstants;
import org.gluu.oxtrust.util.ServiceUtil;
import org.gluu.site.ldap.persistence.LdapEntryManager;
import org.gluu.site.ldap.persistence.exception.LdapMappingException;
import org.gluu.persist.PersistenceEntryManager;
import org.gluu.persist.exception.BasePersistenceException;
import org.slf4j.Logger;
import org.xdi.config.oxtrust.AppConfiguration;
import org.xdi.ldap.model.GluuStatus;
import org.xdi.model.GluuAttribute;
import org.xdi.model.GluuUserRole;
import org.xdi.model.GluuStatus;
import org.xdi.model.user.UserRole;
import org.xdi.oxauth.model.fido.u2f.protocol.DeviceData;
import org.xdi.service.security.Secure;
import org.xdi.util.ArrayHelper;
Expand Down Expand Up @@ -112,8 +112,8 @@ public class UpdatePersonAction implements Serializable {
@Inject
private MemberService memberService;

@Inject
private LdapEntryManager ldapEntryManager;
@Inject
private PersistenceEntryManager ldapEntryManager;

@Inject
private FidoDeviceService fidoDeviceService;
Expand Down Expand Up @@ -218,7 +218,7 @@ public String update() {
this.update = true;
try {
this.person = personService.getPersonByInum(inum);
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to find person {}", inum, ex);

facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to find person");
Expand Down Expand Up @@ -247,8 +247,7 @@ public String update() {
if (gluuCustomFidoDevices != null) {
for (GluuCustomFidoDevice gluuCustomFidoDevice : gluuCustomFidoDevices) {
GluuDeviceDataBean gluuDeviceDataBean = new GluuDeviceDataBean();
gluuDeviceDataBean.setCreationDate(ldapEntryManager
.decodeGeneralizedTime(gluuCustomFidoDevice.getCreationDate()).toGMTString());
gluuDeviceDataBean.setCreationDate(ldapEntryManager.decodeTime(gluuCustomFidoDevice.getCreationDate()).toGMTString());
gluuDeviceDataBean.setId(gluuCustomFidoDevice.getId());
String devicedata = gluuCustomFidoDevice.getDeviceData();
String modality = "";
Expand Down Expand Up @@ -403,7 +402,7 @@ public String save() throws Exception {
if (runScript) {
externalUpdateUserService.executeExternalPostUpdateUserMethods(this.person);
}
} catch (LdapMappingException ex) {
} catch (Exception ex) {
log.error("Failed to update person {}", inum, ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR,
"Failed to update person '#{updatePersonAction.person.displayName}'");
Expand Down Expand Up @@ -451,7 +450,7 @@ public String save() throws Exception {
if (runScript) {
externalUpdateUserService.executeExternalPostAddUserMethods(this.person);
}
} catch (Exception ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to add new person {}", this.person.getInum(), ex);
facesMessages.add(FacesMessage.SEVERITY_ERROR, "Failed to add new person'");

Expand Down Expand Up @@ -512,7 +511,7 @@ public String delete() {
conversationService.endConversation();

return OxTrustConstants.RESULT_SUCCESS;
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to remove person {}", this.person.getInum(), ex);
}
}
Expand All @@ -528,7 +527,7 @@ private void initAttributes(boolean add) {
externalUpdateUserService.executeExternalNewUserMethods(this.person);
}

List<GluuAttribute> attributes = attributeService.getAllPersonAttributes(GluuUserRole.ADMIN);
List<GluuAttribute> attributes = attributeService.getAllPersonAttributes(UserRole.ADMIN);
List<String> origins = attributeService.getAllAttributeOrigins(attributes);

List<GluuCustomAttribute> customAttributes = this.person.getCustomAttributes();
Expand Down
Expand Up @@ -76,12 +76,10 @@
import org.gluu.oxtrust.util.OxTrustConstants;
import org.gluu.persist.exception.BasePersistenceException;
import org.gluu.saml.metadata.SAMLMetadataParser;
import org.gluu.site.ldap.persistence.exception.LdapMappingException;
import org.slf4j.Logger;
import org.xdi.config.oxtrust.AppConfiguration;
import org.xdi.ldap.model.GluuStatus;
import org.xdi.model.GluuAttribute;
import org.xdi.model.GluuUserRole;
import org.xdi.model.GluuStatus;
import org.xdi.model.SchemaEntry;
import org.xdi.model.user.UserRole;
import org.xdi.service.SchemaService;
Expand Down Expand Up @@ -246,7 +244,7 @@ public String update() {
this.update = true;
try {
this.trustRelationship = trustService.getRelationshipByInum(inum);
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to find trust relationship {}", inum, ex);
}

Expand Down Expand Up @@ -413,7 +411,7 @@ public String saveImpl() {
if (update) {
try {
saveTR(update);
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to update trust relationship {}", inum, ex);
return OxTrustConstants.RESULT_FAILURE;
}
Expand All @@ -423,7 +421,7 @@ public String saveImpl() {
this.trustRelationship.setDn(dn);
try {
saveTR(update);
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to add new trust relationship {}", this.trustRelationship.getInum(), ex);
return OxTrustConstants.RESULT_FAILURE;
}
Expand Down Expand Up @@ -481,12 +479,12 @@ private boolean initActions() {
}

private List<GluuAttribute> getAllAttributes() {
List<GluuAttribute> attributes = attributeService.getAllPersonAttributes(GluuUserRole.ADMIN);
List<GluuAttribute> attributes = attributeService.getAllPersonAttributes(UserRole.ADMIN);
return attributes;
}

private List<GluuAttribute> getAllActiveAttributes() {
List<GluuAttribute> attributes = attributeService.getAllActivePersonAttributes(GluuUserRole.ADMIN);
List<GluuAttribute> attributes = attributeService.getAllActivePersonAttributes(UserRole.ADMIN);
attributes.remove(attributeService.getAttributeByName("userPassword"));
return attributes;
}
Expand Down Expand Up @@ -746,7 +744,7 @@ private void markAsInactive() {
.getRelationshipByInum(this.trustRelationship.getInum());
tmpTrustRelationship.setStatus(GluuStatus.INACTIVE);
saveTR(update);
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
log.error("Failed to update trust relationship {}", inum, ex);
}
} else {
Expand Down Expand Up @@ -898,7 +896,7 @@ public String delete() {
identity.getCredentials().getUsername());
}
result = OxTrustConstants.RESULT_SUCCESS;
} catch (LdapMappingException ex) {
} catch (BasePersistenceException ex) {
result = OxTrustConstants.RESULT_FAILURE;
log.error("Failed to remove trust relationship {}", this.trustRelationship.getInum(), ex);
} catch (InterruptedException e) {
Expand Down
Expand Up @@ -42,6 +42,7 @@ public class ApplianceService implements Serializable {

@Inject
private PersistenceEntryManager ldapEntryManager;

@Inject
private OrganizationService organizationService;

Expand Down
Expand Up @@ -31,6 +31,7 @@
import org.xdi.model.metric.ldap.MetricEntry;
import org.xdi.service.CacheService;
import org.xdi.util.OxConstants;
import org.slf4j.Logger;

/**
* Store and retrieve metric
Expand Down
Expand Up @@ -3,17 +3,18 @@
*
* Copyright (c) 2014, Gluu
*/

package org.gluu.oxtrust.util;

import org.xdi.util.OxConstants;

/**
* Constants loads the LDAP schema attribute names like uid, iname
*
* @author Yuriy Movchan
* @author Javier Rojas Blum
* @version January 15, 2016
*/
public final class OxTrustConstants {
public final class OxTrustConstants extends OxConstants {

public static final String CURRENT_PERSON = "currentPerson";

Expand Down

0 comments on commit e12f618

Please sign in to comment.