use of org.openkilda.messaging.nbtopology.request.GetFlowsForIslRequest in project open-kilda by telstra.
the class LinkServiceImpl method getFlowsForLink.
@Override
public CompletableFuture<List<FlowResponsePayload>> getFlowsForLink(SwitchId srcSwitch, Integer srcPort, SwitchId dstSwitch, Integer dstPort) {
final String correlationId = RequestCorrelationId.getId();
logger.debug("Get all flows for a particular link request processing");
GetFlowsForIslRequest data = null;
try {
data = new GetFlowsForIslRequest(new NetworkEndpoint(srcSwitch, srcPort), new NetworkEndpoint(dstSwitch, dstPort), correlationId);
} catch (IllegalArgumentException e) {
logger.error("Can not parse arguments: {}", e.getMessage());
throw new MessageException(correlationId, System.currentTimeMillis(), ErrorType.DATA_INVALID, e.getMessage(), "Can not parse arguments when create \"get flows for link\" request");
}
CommandMessage message = new CommandMessage(data, System.currentTimeMillis(), correlationId, Destination.WFM);
return messagingChannel.sendAndGetChunked(nbworkerTopic, message).thenApply(response -> response.stream().map(FlowResponse.class::cast).map(FlowResponse::getPayload).map(flowMapper::toFlowResponseOutput).collect(Collectors.toList()));
}
Aggregations