use of cz.metacentrum.perun.audit.events.ResourceManagerEvents.ResourceCreated in project perun by CESNET.
the class urn_perun_facility_attribute_def_virt_voShortNames method resolveVirtualAttributeValueChange.
@Override
public List<AuditEvent> resolveVirtualAttributeValueChange(PerunSessionImpl sess, AuditEvent message) throws AttributeNotExistsException, WrongAttributeAssignmentException {
List<AuditEvent> resolvingMessages = new ArrayList<>();
if (message == null)
return resolvingMessages;
if (message instanceof ResourceCreated) {
try {
Facility facility = sess.getPerunBl().getFacilitiesManagerBl().getFacilityById(sess, ((ResourceCreated) message).getResource().getFacilityId());
resolvingMessages.addAll(resolveEvent(sess, facility));
} catch (FacilityNotExistsException e) {
throw new ConsistencyErrorException("Facility for created Resource doesn't exists when resolving messages.", e);
}
} else if (message instanceof ResourceDeleted) {
resolvingMessages.addAll(resolveEvent(sess, ((ResourceDeleted) message).getFacility()));
}
return resolvingMessages;
}
Aggregations