use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForHost in project perun by CESNET.
the class AttributesManagerBlImpl method removeAllAttributes.
@Override
public void removeAllAttributes(PerunSession sess, Host host) throws WrongAttributeValueException {
List<Attribute> attributes = getAttributes(sess, host);
if (getAttributesManagerImpl().removeAllAttributes(sess, host)) {
getPerunBl().getAuditer().log(sess, new AllAttributesRemovedForHost(host));
}
log.info("{} removed all attributes from host {}.", sess.getLogId(), host.getId());
for (Attribute attribute : attributes) attribute.setValue(null);
try {
checkAttributesSemantics(sess, host, attributes);
checkAttributesDependencies(sess, host, attributes);
} catch (WrongAttributeAssignmentException ex) {
throw new ConsistencyErrorException(ex);
} catch (WrongReferenceAttributeValueException ex) {
throw new WrongAttributeValueException(ex);
}
for (Attribute attribute : attributes) {
getAttributesManagerImpl().changedAttributeHook(sess, host, new Attribute(attribute));
}
}
Aggregations