Search in sources :

Example 1 with AttributeSetForMember

use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForMember in project perun by CESNET.

the class AttributesManagerBlImpl method setAttributeWithoutCheck.

@Override
public boolean setAttributeWithoutCheck(PerunSession sess, Member member, Attribute attribute) throws WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
    getAttributesManagerImpl().checkNamespace(sess, attribute, AttributesManager.NS_MEMBER_ATTR);
    boolean changed;
    if (isVirtAttribute(sess, attribute)) {
        return getAttributesManagerImpl().setVirtualAttribute(sess, member, attribute);
    // FIXME update "changed" variable
    } else if (isCoreAttribute(sess, attribute)) {
        try {
            setCoreAttributeWithoutCheck(sess, member, attribute);
        } catch (WrongReferenceAttributeValueException | WrongAttributeValueException ex) {
            throw new InternalErrorException(ex);
        }
        // FIXME check if attribute is acctualy changed
        changed = true;
    } else {
        changed = getAttributesManagerImpl().setAttribute(sess, member, attribute);
    }
    if (changed) {
        getPerunBl().getAuditer().log(sess, new AttributeSetForMember(attribute, member));
        getAttributesManagerImpl().changedAttributeHook(sess, member, attribute);
    }
    return changed;
}
Also used : InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException) AttributeSetForMember(cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForMember)

Aggregations

AttributeSetForMember (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForMember)1 InternalErrorException (cz.metacentrum.perun.core.api.exceptions.InternalErrorException)1