use of org.openkilda.messaging.nbtopology.request.RerouteFlowsForIslRequest in project open-kilda by telstra.
the class LinkServiceImpl method rerouteFlowsForLink.
@Override
public CompletableFuture<List<String>> rerouteFlowsForLink(SwitchId srcSwitch, Integer srcPort, SwitchId dstSwitch, Integer dstPort) {
final String correlationId = RequestCorrelationId.getId();
logger.debug("Reroute all flows for a particular link request processing");
RerouteFlowsForIslRequest data = null;
try {
data = new RerouteFlowsForIslRequest(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 \"reroute flows for link\" request");
}
CommandMessage message = new CommandMessage(data, System.currentTimeMillis(), correlationId, Destination.WFM);
return messagingChannel.sendAndGetChunked(nbworkerTopic, message).thenApply(response -> response.stream().map(FlowsResponse.class::cast).map(FlowsResponse::getFlowIds).flatMap(Collection::stream).collect(Collectors.toList()));
}
Aggregations