use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeSetForResource in project perun by CESNET.
the class AttributesManagerBlImpl method setAttributeWithoutCheck.
@Override
public boolean setAttributeWithoutCheck(PerunSession sess, Resource resource, Attribute attribute) throws WrongAttributeAssignmentException, WrongAttributeValueException, WrongReferenceAttributeValueException {
getAttributesManagerImpl().checkNamespace(sess, attribute, AttributesManager.NS_RESOURCE_ATTR);
if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
throw new WrongAttributeAssignmentException(attribute);
boolean changed;
if (isVirtAttribute(sess, attribute)) {
try {
changed = getAttributesManagerImpl().setVirtualAttribute(sess, resource, attribute);
} catch (WrongReferenceAttributeValueException ex) {
throw new InternalErrorException(ex);
}
} else {
changed = getAttributesManagerImpl().setAttribute(sess, resource, attribute);
}
if (changed) {
getPerunBl().getAuditer().log(sess, new AttributeSetForResource(attribute, resource));
getAttributesManagerImpl().changedAttributeHook(sess, resource, attribute);
}
return changed;
}
Aggregations