use of org.openkilda.messaging.command.yflow.SubFlowsResponse in project open-kilda by telstra.
the class YFlowReadBolt method handleInput.
protected void handleInput(Tuple input) throws Exception {
String requestId = getCommandContext().getCorrelationId();
CommandData request = pullValue(input, FIELD_ID_PAYLOAD, CommandData.class);
try {
if (request instanceof YFlowsDumpRequest) {
List<YFlowResponse> result = processYFlowDumpRequest();
emitMessages(input, requestId, result);
} else if (request instanceof YFlowReadRequest) {
YFlowResponse result = processYFlowReadRequest((YFlowReadRequest) request);
emitMessage(input, requestId, result);
} else if (request instanceof YFlowPathsReadRequest) {
YFlowPathsResponse result = processYFlowPathsReadRequest((YFlowPathsReadRequest) request);
emitMessage(input, requestId, result);
} else if (request instanceof SubFlowsReadRequest) {
SubFlowsResponse result = processSubFlowsReadRequest((SubFlowsReadRequest) request);
emitMessage(input, requestId, result);
} else {
unhandledInput(input);
}
} catch (MessageException e) {
ErrorData errorData = new ErrorData(e.getErrorType(), e.getMessage(), e.getErrorDescription());
Message message = new ErrorMessage(errorData, System.currentTimeMillis(), requestId);
emit(input, new Values(requestId, message));
}
}
use of org.openkilda.messaging.command.yflow.SubFlowsResponse in project open-kilda by telstra.
the class YFlowReadServiceTest method shouldFetchYFlowSubFlows.
@Test
public void shouldFetchYFlowSubFlows() throws FlowNotFoundException {
// given
String yFlowId = "test_y_flow_1";
createYFlowViaTransit(yFlowId);
// when
SubFlowsResponse yFlowResponse = yFlowReadService.getYFlowSubFlows(yFlowId);
// then
assertEquals(2, yFlowResponse.getFlows().size());
}
Aggregations