use of org.openkilda.northbound.dto.v2.flows.FlowHistoryStatusesResponse in project open-kilda by telstra.
the class FlowServiceImpl method getFlowStatuses.
@Override
public CompletableFuture<FlowHistoryStatusesResponse> getFlowStatuses(String flowId, long timestampFrom, long timestampTo, int maxCount) {
if (maxCount < 1) {
throw new MessageException(RequestCorrelationId.getId(), System.currentTimeMillis(), ErrorType.PARAMETERS_INVALID, format("Invalid `max_count` argument '%s'.", maxCount), "`max_count` argument must be positive.");
}
String correlationId = RequestCorrelationId.getId();
GetFlowStatusTimestampsRequest request = GetFlowStatusTimestampsRequest.builder().flowId(flowId).timestampFrom(timestampFrom).timestampTo(timestampTo).maxCount(maxCount).build();
CommandMessage command = new CommandMessage(request, System.currentTimeMillis(), correlationId);
return messagingChannel.sendAndGetChunked(nbworkerTopic, command).thenApply(result -> result.stream().map(FlowStatusTimestampsEntry.class::cast).map(flowMapper::toFlowHistoryStatus).collect(Collectors.toList())).thenApply(FlowHistoryStatusesResponse::new);
}
Aggregations