use of org.openkilda.messaging.nbtopology.request.GetFlowLoopsRequest in project open-kilda by telstra.
the class FlowServiceImpl method getFlowLoops.
@Override
public CompletableFuture<List<FlowLoopResponse>> getFlowLoops(String flowId, String switchId) {
logger.info("Get flow loops for flow {} and switch {}", flowId, switchId);
GetFlowLoopsRequest request = new GetFlowLoopsRequest(flowId, switchId);
CommandMessage message = new CommandMessage(request, System.currentTimeMillis(), RequestCorrelationId.getId(), Destination.WFM);
return messagingChannel.sendAndGet(nbworkerTopic, message).thenApply(result -> Optional.of(result).map(FlowLoopsResponse.class::cast).map(FlowLoopsResponse::getPayload).orElse(Collections.emptyList()).stream().map(flowMapper::toFlowLoopResponse).collect(Collectors.toList()));
}
Aggregations