Search in sources :

Example 1 with AllAttributesRemovedForVo

use of cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForVo in project perun by CESNET.

the class AttributesManagerBlImpl method removeAllAttributes.

@Override
public void removeAllAttributes(PerunSession sess, Vo vo) throws WrongAttributeValueException, WrongReferenceAttributeValueException {
    List<Attribute> attributes = getAttributes(sess, vo);
    if (getAttributesManagerImpl().removeAllAttributes(sess, vo)) {
        getPerunBl().getAuditer().log(sess, new AllAttributesRemovedForVo(vo));
    }
    log.info("{} removed all attributes from vo {}.", sess.getLogId(), vo.getId());
    for (Attribute attribute : attributes) attribute.setValue(null);
    try {
        checkAttributesSemantics(sess, vo, attributes);
        checkAttributesDependencies(sess, vo, attributes);
    } catch (WrongAttributeAssignmentException ex) {
        throw new ConsistencyErrorException(ex);
    }
    for (Attribute attribute : attributes) {
        getAttributesManagerImpl().changedAttributeHook(sess, vo, new Attribute(attribute));
    }
}
Also used : ConsistencyErrorException(cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException) Attribute(cz.metacentrum.perun.core.api.Attribute) RichAttribute(cz.metacentrum.perun.core.api.RichAttribute) WrongAttributeAssignmentException(cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException) AllAttributesRemovedForVo(cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForVo)

Aggregations

AllAttributesRemovedForVo (cz.metacentrum.perun.audit.events.AttributesManagerEvents.AllAttributesRemovedForVo)1 Attribute (cz.metacentrum.perun.core.api.Attribute)1 RichAttribute (cz.metacentrum.perun.core.api.RichAttribute)1 ConsistencyErrorException (cz.metacentrum.perun.core.api.exceptions.ConsistencyErrorException)1 WrongAttributeAssignmentException (cz.metacentrum.perun.core.api.exceptions.WrongAttributeAssignmentException)1