Search in sources :

Example 1 with FlowRerouteResponse

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());
}
Also used : PathInfoData(org.openkilda.messaging.info.event.PathInfoData) FlowPathMapper(org.openkilda.wfm.share.mappers.FlowPathMapper) FlowRerouteResponse(org.openkilda.messaging.info.flow.FlowRerouteResponse) InfoMessage(org.openkilda.messaging.info.InfoMessage)

Aggregations

InfoMessage (org.openkilda.messaging.info.InfoMessage)1 PathInfoData (org.openkilda.messaging.info.event.PathInfoData)1 FlowRerouteResponse (org.openkilda.messaging.info.flow.FlowRerouteResponse)1 FlowPathMapper (org.openkilda.wfm.share.mappers.FlowPathMapper)1