Search in sources :

Example 1 with AttributeSetForFacility

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

the class AttributesManagerBlImpl method setAttributeWithoutCheck.

@Override
public boolean setAttributeWithoutCheck(PerunSession sess, Facility facility, Attribute attribute) throws WrongAttributeAssignmentException, WrongAttributeValueException {
    getAttributesManagerImpl().checkNamespace(sess, attribute, NS_FACILITY_ATTR);
    if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
        throw new WrongAttributeAssignmentException(attribute);
    boolean changed;
    if (isVirtAttribute(sess, attribute)) {
        throw new InternalErrorException("Virtual attribute can't be set this way yet. Please set physical attribute.");
    } else {
        changed = getAttributesManagerImpl().setAttribute(sess, facility, attribute);
    }
    if (changed) {
        getPerunBl().getAuditer().log(sess, new AttributeSetForFacility(attribute, facility));
        getAttributesManagerImpl().changedAttributeHook(sess, facility, attribute);
    }
    return changed;
}
Also used : AttributeSetForFacility(cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForFacility) WrongAttributeAssignmentException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException) InternalErrorException(cz.metacentrum.perun.core.api.exceptions.InternalErrorException)

Aggregations

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