use of org.openkilda.wfm.error.IllegalFlowStateException in project open-kilda by telstra.
the class FlowValidationFsm method receiveData.
protected void receiveData(State from, State to, Event event, Object context) {
Flow flow;
try {
flow = service.checkFlowStatusAndGetFlow(flowId);
} catch (FlowNotFoundException e) {
log.error("Flow {} not found when sending commands to SpeakerWorkerBolt", flowId, e);
sendException(e.getMessage(), "Receiving rules operation in FlowValidationFsm", ErrorType.NOT_FOUND);
return;
} catch (IllegalFlowStateException e) {
log.error("Could not validate flow: Flow {} is in DOWN state", flowId, e);
sendException("Could not validate flow", format("Could not validate flow: Flow %s is in DOWN state", flowId), ErrorType.UNPROCESSABLE_REQUEST);
return;
}
List<SwitchId> switchIds = service.getSwitchIdListByFlowId(flowId);
awaitingRules = switchIds.size();
log.debug("Send commands to get rules on the switches");
switchIds.forEach(switchId -> getCarrier().sendSpeakerRequest(flowId, new DumpRulesForFlowHsRequest(switchId)));
log.debug("Send commands to get meters on the termination switches");
awaitingMeters = TERMINATION_SWITCHES_COUNT;
getCarrier().sendSpeakerRequest(flowId, new DumpMetersForFlowHsRequest(flow.getSrcSwitchId()));
getCarrier().sendSpeakerRequest(flowId, new DumpMetersForFlowHsRequest(flow.getDestSwitchId()));
log.debug("Send commands to get groups on the termination switches");
awaitingGroups = TERMINATION_SWITCHES_COUNT;
getCarrier().sendSpeakerRequest(flowId, new DumpGroupsForFlowHsRequest(flow.getSrcSwitchId()));
getCarrier().sendSpeakerRequest(flowId, new DumpGroupsForFlowHsRequest(flow.getDestSwitchId()));
}
Aggregations