use of org.gluu.oxtrust.exception.DuplicateEmailException in project oxTrust by GluuFederation.
the class PersonService method updatePerson.
/*
* (non-Javadoc)
*
* @see
* org.gluu.oxtrust.ldap.service.IPersonService#updatePerson(org.gluu.oxtrust.
* model.GluuCustomPerson)
*/
@Override
public void updatePerson(GluuCustomPerson person) throws Exception {
try {
Date updateDate = new Date();
person.setUpdatedAt(updateDate);
if (person.getAttribute("oxTrustMetaLastModified") != null) {
person.setAttribute("oxTrustMetaLastModified", Instant.ofEpochMilli(updateDate.getTime()).toString());
}
persistenceEntryManager.merge(person);
} catch (Exception e) {
if (e.getCause().getMessage().contains("unique attribute conflict was detected for attribute mail")) {
throw new DuplicateEmailException("Email Already Registered");
} else {
throw new Exception("Duplicate UID value: " + person.getUid(), e);
}
}
}
Aggregations