use of org.openkilda.messaging.info.reroute.PathSwapResult in project open-kilda by telstra.
the class FlowPathSwapHubBolt method sendPathSwapResultStatus.
@Override
public void sendPathSwapResultStatus(String flowId, boolean success, String correlationId) {
PathSwapResult pathSwapResult = PathSwapResult.builder().flowId(flowId).success(success).build();
Message message = new InfoMessage(pathSwapResult, System.currentTimeMillis(), correlationId);
emitWithContext(Stream.HUB_TO_REROUTE_RESPONSE_SENDER.name(), getCurrentTuple(), new Values(currentKey, message));
}
use of org.openkilda.messaging.info.reroute.PathSwapResult in project open-kilda by telstra.
the class OperationQueueBolt method handleInput.
@Override
protected void handleInput(Tuple tuple) throws PipelineException {
CommandContext context = pullContext(tuple);
MessageData data = pullValue(tuple, FIELD_ID_PAYLOAD, MessageData.class);
if (data instanceof FlowPathSwapRequest) {
FlowPathSwapRequest flowPathSwapRequest = (FlowPathSwapRequest) data;
service.addFirst(flowPathSwapRequest.getFlowId(), context.getCorrelationId(), flowPathSwapRequest);
} else if (data instanceof FlowRerouteRequest) {
FlowRerouteRequest flowRerouteRequest = (FlowRerouteRequest) data;
service.addLast(flowRerouteRequest.getFlowId(), context.getCorrelationId(), flowRerouteRequest);
} else if (data instanceof YFlowRerouteRequest) {
YFlowRerouteRequest yFlowRerouteRequest = (YFlowRerouteRequest) data;
service.addLast(yFlowRerouteRequest.getYFlowId(), context.getCorrelationId(), yFlowRerouteRequest);
} else if (data instanceof RerouteResultInfoData) {
RerouteResultInfoData rerouteResultInfoData = (RerouteResultInfoData) data;
service.operationCompleted(rerouteResultInfoData.getFlowId(), rerouteResultInfoData);
emitRerouteResponse(rerouteResultInfoData);
} else if (data instanceof PathSwapResult) {
PathSwapResult pathSwapResult = (PathSwapResult) data;
service.operationCompleted(pathSwapResult.getFlowId(), pathSwapResult);
} else {
unhandledInput(tuple);
}
}
use of org.openkilda.messaging.info.reroute.PathSwapResult in project open-kilda by telstra.
the class RerouteBolt method handleInfoMessage.
private void handleInfoMessage(Message message) {
if (message instanceof InfoMessage) {
InfoData infoData = ((InfoMessage) message).getData();
if (infoData instanceof RerouteResultInfoData) {
RerouteResultInfoData rerouteResultInfoData = (RerouteResultInfoData) infoData;
emitWithContext(STREAM_OPERATION_QUEUE_ID, getCurrentTuple(), new Values(rerouteResultInfoData.getFlowId(), rerouteResultInfoData));
} else if (infoData instanceof PathSwapResult) {
PathSwapResult pathSwapResult = (PathSwapResult) infoData;
emitWithContext(STREAM_OPERATION_QUEUE_ID, getCurrentTuple(), new Values(pathSwapResult.getFlowId(), pathSwapResult));
} else if (infoData instanceof SwitchStateChanged) {
if (active) {
rerouteService.processSingleSwitchFlowStatusUpdate((SwitchStateChanged) infoData);
}
} else {
unhandledInput(getCurrentTuple());
}
} else {
unhandledInput(getCurrentTuple());
}
}
Aggregations