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