use of org.openkilda.messaging.nbtopology.request.GetFlowsForSwitchRequest in project open-kilda by telstra.
the class SwitchServiceImpl method getFlowsForSwitch.
@Override
public CompletableFuture<List<FlowPayload>> getFlowsForSwitch(SwitchId switchId, Integer port) {
final String correlationId = RequestCorrelationId.getId();
logger.debug("Get all flows for the switch: {}", switchId);
GetFlowsForSwitchRequest data = new GetFlowsForSwitchRequest(switchId, port);
CommandMessage message = new CommandMessage(data, System.currentTimeMillis(), correlationId);
return messagingChannel.sendAndGetChunked(nbworkerTopic, message).thenApply(response -> response.stream().map(FlowResponse.class::cast).map(FlowResponse::getPayload).map(flowMapper::toFlowOutput).collect(Collectors.toList()));
}
Aggregations