Search in sources :

Example 1 with AttributeSetForHost

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

the class AttributesManagerBlImpl method setAttributeWithoutCheck.

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

Aggregations

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