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