use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.
the class ActionBolt method sendFlowRerouteRequest.
@Override
public void sendFlowRerouteRequest(String flowId) {
FlowRerouteRequest request = new FlowRerouteRequest(flowId, false, false, false, Collections.emptySet(), "Flow latency become unhealthy", false);
emit(getCurrentTuple(), new Values(request, getCommandContext()));
}
use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.
the class ActionBolt method sendFlowSyncRequest.
@Override
public void sendFlowSyncRequest(String flowId) {
FlowRerouteRequest request = new FlowRerouteRequest(flowId, true, false, false, Collections.emptySet(), "Flow latency become healthy", false);
emit(getCurrentTuple(), new Values(request, getCommandContext()));
}
use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.
the class FlowServiceImpl method reroute.
private CompletableFuture<FlowReroutePayload> reroute(String flowId, boolean forced) {
logger.debug("Reroute flow: {}={}, forced={}", FLOW_ID, flowId, forced);
String correlationId = RequestCorrelationId.getId();
FlowRerouteRequest payload = createManualFlowRerouteRequest(flowId, forced, false, "initiated via Northbound");
CommandMessage command = new CommandMessage(payload, System.currentTimeMillis(), correlationId, Destination.WFM);
return messagingChannel.sendAndGet(rerouteTopic, command).thenApply(FlowRerouteResponse.class::cast).thenApply(response -> flowMapper.toReroutePayload(flowId, response.getPayload(), response.isRerouted()));
}
use of org.openkilda.messaging.command.flow.FlowRerouteRequest in project open-kilda by telstra.
the class FlowServiceImpl method rerouteFlowV2.
@Override
public CompletableFuture<FlowRerouteResponseV2> rerouteFlowV2(String flowId) {
logger.info("Processing flow reroute: {}", flowId);
FlowRerouteRequest payload = createManualFlowRerouteRequest(flowId, false, false, "initiated via Northbound");
CommandMessage command = new CommandMessage(payload, System.currentTimeMillis(), RequestCorrelationId.getId(), Destination.WFM);
return messagingChannel.sendAndGet(rerouteTopic, command).thenApply(FlowRerouteResponse.class::cast).thenApply(response -> flowMapper.toRerouteResponseV2(flowId, response.getPayload(), response.isRerouted()));
}
Aggregations