Search in sources :

Example 1 with InvalidAttributeValueException

use of org.springframework.ldap.InvalidAttributeValueException in project perun by CESNET.

the class UserAttributeProcessor method processAdminAdded.

public void processAdminAdded(String msg, MessageBeans beans) {
    if (beans.getUser() == null) {
        return;
    }
    PerunBean admined = null;
    try {
        if (beans.getVo() != null) {
            admined = beans.getVo();
            perunUser.addAsVoAdmin(beans.getUser(), beans.getVo());
        } else if (beans.getGroup() != null) {
            admined = beans.getGroup();
            perunUser.addAsGroupAdmin(beans.getUser(), beans.getGroup());
        } else if (beans.getFacility() != null) {
            admined = beans.getFacility();
            perunUser.addAsFacilityAdmin(beans.getUser(), beans.getFacility());
        }
    } catch (NamingException | InternalErrorException e) {
        log.error("Error adding user {} as admin of {}: {}", beans.getUser().getId(), admined.getId(), ((InvalidAttributeValueException) e).getExplanation(), e);
    }
}
Also used : PerunBean(cz.metacentrum.perun.core.api.PerunBean) NamingException(org.springframework.ldap.NamingException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) InvalidAttributeValueException(org.springframework.ldap.InvalidAttributeValueException)

Aggregations

PerunBean (cz.metacentrum.perun.core.api.PerunBean)1 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)1 InvalidAttributeValueException (org.springframework.ldap.InvalidAttributeValueException)1 NamingException (org.springframework.ldap.NamingException)1