use of org.openkilda.messaging.nbtopology.request.FlowPatchRequest in project open-kilda by telstra.
the class FlowServiceImpl method patchFlow.
@Override
public CompletableFuture<FlowResponseV2> patchFlow(String flowId, FlowPatchV2 flowPatchDto) {
logger.info("Patch flow request for flow {}", flowId);
String correlationId = RequestCorrelationId.getId();
FlowPatch flowPatch;
try {
flowPatch = flowMapper.toFlowPatch(flowPatchDto);
} catch (IllegalArgumentException e) {
logger.error("Can not parse arguments: {}", e.getMessage(), e);
throw new MessageException(correlationId, System.currentTimeMillis(), ErrorType.DATA_INVALID, e.getMessage(), "Can not parse arguments of the flow patch request");
}
flowPatch.setFlowId(flowId);
CommandMessage request = new CommandMessage(new FlowPatchRequest(flowPatch), System.currentTimeMillis(), correlationId);
return messagingChannel.sendAndGet(nbworkerTopic, request).thenApply(FlowResponse.class::cast).thenApply(FlowResponse::getPayload).thenApply(flowMapper::toFlowResponseV2);
}
use of org.openkilda.messaging.nbtopology.request.FlowPatchRequest in project open-kilda by telstra.
the class FlowServiceImpl method patchFlow.
@Override
public CompletableFuture<FlowResponsePayload> patchFlow(String flowId, FlowPatchDto flowPatchDto) {
logger.info("Patch flow request for flow {}", flowId);
String correlationId = RequestCorrelationId.getId();
FlowPatch flowPatch;
try {
flowPatch = flowMapper.toFlowPatch(flowPatchDto);
} catch (IllegalArgumentException e) {
logger.error("Can not parse arguments: {}", e.getMessage(), e);
throw new MessageException(correlationId, System.currentTimeMillis(), ErrorType.DATA_INVALID, e.getMessage(), "Can not parse arguments of the flow patch request");
}
flowPatch.setFlowId(flowId);
CommandMessage request = new CommandMessage(new FlowPatchRequest(flowPatch), System.currentTimeMillis(), correlationId);
return messagingChannel.sendAndGet(nbworkerTopic, request).thenApply(FlowResponse.class::cast).thenApply(FlowResponse::getPayload).thenApply(flowMapper::toFlowResponseOutput);
}
Aggregations