Search in sources :

Example 1 with YFlowDump

use of org.openkilda.northbound.dto.v2.yflows.YFlowDump in project open-kilda by telstra.

the class YFlowServiceImpl method dumpYFlows.

@Override
public CompletableFuture<YFlowDump> dumpYFlows() {
    log.debug("Processing getting all y-flows");
    YFlowsDumpRequest dumpRequest = new YFlowsDumpRequest();
    CommandMessage request = new CommandMessage(dumpRequest, System.currentTimeMillis(), RequestCorrelationId.getId());
    return messagingChannel.sendAndGetChunked(flowHsTopic, request).thenApply(result -> result.stream().map(YFlowResponse.class::cast).map(YFlowResponse::getYFlow).map(flowMapper::toYFlow).collect(Collectors.toList())).thenApply(YFlowDump::new);
}
Also used : YFlowPingResponse(org.openkilda.messaging.info.flow.YFlowPingResponse) YFlowResponse(org.openkilda.messaging.command.yflow.YFlowResponse) YFlowCreatePayload(org.openkilda.northbound.dto.v2.yflows.YFlowCreatePayload) Autowired(org.springframework.beans.factory.annotation.Autowired) CompletableFuture(java.util.concurrent.CompletableFuture) YFlowSyncRequest(org.openkilda.messaging.command.yflow.YFlowSyncRequest) MessageException(org.openkilda.messaging.error.MessageException) Value(org.springframework.beans.factory.annotation.Value) CommandMessage(org.openkilda.messaging.command.CommandMessage) Service(org.springframework.stereotype.Service) YFlowsDumpRequest(org.openkilda.messaging.command.yflow.YFlowsDumpRequest) MessagingChannel(org.openkilda.northbound.messaging.MessagingChannel) SubFlowsResponse(org.openkilda.messaging.command.yflow.SubFlowsResponse) YFlow(org.openkilda.northbound.dto.v2.yflows.YFlow) YFlowValidationResponse(org.openkilda.messaging.command.yflow.YFlowValidationResponse) YFlowPathsResponse(org.openkilda.messaging.command.yflow.YFlowPathsResponse) YFlowRequest(org.openkilda.messaging.command.yflow.YFlowRequest) YFlowReadRequest(org.openkilda.messaging.command.yflow.YFlowReadRequest) YFlowService(org.openkilda.northbound.service.YFlowService) ErrorType(org.openkilda.messaging.error.ErrorType) SubFlowsDump(org.openkilda.northbound.dto.v2.yflows.SubFlowsDump) YFlowDeleteRequest(org.openkilda.messaging.command.yflow.YFlowDeleteRequest) YFlowMapper(org.openkilda.northbound.converter.YFlowMapper) YFlowDump(org.openkilda.northbound.dto.v2.yflows.YFlowDump) YFlowPingResult(org.openkilda.northbound.dto.v2.yflows.YFlowPingResult) YFlowValidationRequest(org.openkilda.messaging.command.yflow.YFlowValidationRequest) RequestCorrelationId(org.openkilda.northbound.utils.RequestCorrelationId) Collectors(java.util.stream.Collectors) YFlowValidationResult(org.openkilda.northbound.dto.v2.yflows.YFlowValidationResult) YFlowPathsReadRequest(org.openkilda.messaging.command.yflow.YFlowPathsReadRequest) YFlowPatchPayload(org.openkilda.northbound.dto.v2.yflows.YFlowPatchPayload) YFlowRerouteResponse(org.openkilda.messaging.command.yflow.YFlowRerouteResponse) Slf4j(lombok.extern.slf4j.Slf4j) YFlowPingRequest(org.openkilda.messaging.command.flow.YFlowPingRequest) YFlowUpdatePayload(org.openkilda.northbound.dto.v2.yflows.YFlowUpdatePayload) YFlowRerouteRequest(org.openkilda.messaging.command.yflow.YFlowRerouteRequest) YFlowPaths(org.openkilda.northbound.dto.v2.yflows.YFlowPaths) YFlowSyncResult(org.openkilda.northbound.dto.v2.yflows.YFlowSyncResult) YFlowRerouteResult(org.openkilda.northbound.dto.v2.yflows.YFlowRerouteResult) SubFlowsReadRequest(org.openkilda.messaging.command.yflow.SubFlowsReadRequest) YFlowPingPayload(org.openkilda.northbound.dto.v2.yflows.YFlowPingPayload) YFlowPartialUpdateRequest(org.openkilda.messaging.command.yflow.YFlowPartialUpdateRequest) YFlowResponse(org.openkilda.messaging.command.yflow.YFlowResponse) YFlowDump(org.openkilda.northbound.dto.v2.yflows.YFlowDump) YFlowsDumpRequest(org.openkilda.messaging.command.yflow.YFlowsDumpRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

CompletableFuture (java.util.concurrent.CompletableFuture)1 Collectors (java.util.stream.Collectors)1 Slf4j (lombok.extern.slf4j.Slf4j)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 YFlowPingRequest (org.openkilda.messaging.command.flow.YFlowPingRequest)1 SubFlowsReadRequest (org.openkilda.messaging.command.yflow.SubFlowsReadRequest)1 SubFlowsResponse (org.openkilda.messaging.command.yflow.SubFlowsResponse)1 YFlowDeleteRequest (org.openkilda.messaging.command.yflow.YFlowDeleteRequest)1 YFlowPartialUpdateRequest (org.openkilda.messaging.command.yflow.YFlowPartialUpdateRequest)1 YFlowPathsReadRequest (org.openkilda.messaging.command.yflow.YFlowPathsReadRequest)1 YFlowPathsResponse (org.openkilda.messaging.command.yflow.YFlowPathsResponse)1 YFlowReadRequest (org.openkilda.messaging.command.yflow.YFlowReadRequest)1 YFlowRequest (org.openkilda.messaging.command.yflow.YFlowRequest)1 YFlowRerouteRequest (org.openkilda.messaging.command.yflow.YFlowRerouteRequest)1 YFlowRerouteResponse (org.openkilda.messaging.command.yflow.YFlowRerouteResponse)1 YFlowResponse (org.openkilda.messaging.command.yflow.YFlowResponse)1 YFlowSyncRequest (org.openkilda.messaging.command.yflow.YFlowSyncRequest)1 YFlowValidationRequest (org.openkilda.messaging.command.yflow.YFlowValidationRequest)1 YFlowValidationResponse (org.openkilda.messaging.command.yflow.YFlowValidationResponse)1 YFlowsDumpRequest (org.openkilda.messaging.command.yflow.YFlowsDumpRequest)1