use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AttributeRemovedForHost in project perun by CESNET.
the class AttributesManagerBlImpl method removeAttributeWithoutCheck.
@Override
public boolean removeAttributeWithoutCheck(PerunSession sess, Host host, AttributeDefinition attribute) throws WrongAttributeAssignmentException {
getAttributesManagerImpl().checkNamespace(sess, attribute, AttributesManager.NS_HOST_ATTR);
if (getAttributesManagerImpl().isCoreAttribute(sess, attribute))
throw new WrongAttributeAssignmentException(attribute);
boolean changed = getAttributesManagerImpl().removeAttribute(sess, host, attribute);
if (changed) {
getAttributesManagerImpl().changedAttributeHook(sess, host, new Attribute(attribute));
log.info("{} removed attribute {} from host {}.", sess.getLogId(), attribute.getName(), host.getId());
getPerunBl().getAuditer().log(sess, new AttributeRemovedForHost(new AttributeDefinition(attribute), host));
}
return changed;
}
Aggregations