use of org.openkilda.messaging.info.flow.FlowRerouteResponse in project open-kilda by telstra.
the class PostResourceAllocationAction method buildRerouteResponseMessage.
private Message buildRerouteResponseMessage(FlowPath currentForward, FlowPath newForward, CommandContext commandContext) {
PathInfoData currentPath = FlowPathMapper.INSTANCE.map(currentForward);
PathInfoData resultPath = Optional.ofNullable(newForward).map(FlowPathMapper.INSTANCE::map).orElse(currentPath);
FlowRerouteResponse response = new FlowRerouteResponse(resultPath, !resultPath.equals(currentPath));
return new InfoMessage(response, commandContext.getCreateTime(), commandContext.getCorrelationId());
}
Aggregations