Search in sources :

Example 1 with FlowReadRequest

use of org.openkilda.messaging.nbtopology.request.FlowReadRequest in project open-kilda by telstra.

the class FlowServiceImpl method getFlowV2.

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<FlowResponseV2> getFlowV2(final String id) {
    logger.debug("Get flow request for flow {}", id);
    FlowReadRequest data = new FlowReadRequest(id);
    CommandMessage request = new CommandMessage(data, System.currentTimeMillis(), RequestCorrelationId.getId(), Destination.WFM);
    return messagingChannel.sendAndGet(nbworkerTopic, request).thenApply(FlowResponse.class::cast).thenApply(FlowResponse::getPayload).thenApply(flowMapper::toFlowResponseV2);
}
Also used : FlowReadRequest(org.openkilda.messaging.nbtopology.request.FlowReadRequest) FlowResponse(org.openkilda.messaging.info.flow.FlowResponse) SwapFlowResponse(org.openkilda.messaging.info.flow.SwapFlowResponse) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Example 2 with FlowReadRequest

use of org.openkilda.messaging.nbtopology.request.FlowReadRequest in project open-kilda by telstra.

the class FlowServiceImpl method getFlowResponse.

/**
 * Reads {@link FlowResponse} flow representation from the Storm.
 *
 * @return the bidirectional flow.
 */
private CompletableFuture<FlowDto> getFlowResponse(String flowId, String correlationId) {
    FlowReadRequest data = new FlowReadRequest(flowId);
    CommandMessage request = new CommandMessage(data, System.currentTimeMillis(), correlationId, Destination.WFM);
    return messagingChannel.sendAndGet(nbworkerTopic, request).thenApply(FlowResponse.class::cast).thenApply(FlowResponse::getPayload);
}
Also used : FlowReadRequest(org.openkilda.messaging.nbtopology.request.FlowReadRequest) FlowResponse(org.openkilda.messaging.info.flow.FlowResponse) SwapFlowResponse(org.openkilda.messaging.info.flow.SwapFlowResponse) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

CommandMessage (org.openkilda.messaging.command.CommandMessage)2 FlowResponse (org.openkilda.messaging.info.flow.FlowResponse)2 SwapFlowResponse (org.openkilda.messaging.info.flow.SwapFlowResponse)2 FlowReadRequest (org.openkilda.messaging.nbtopology.request.FlowReadRequest)2