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