Search in sources :

Example 1 with PortHistoryRequest

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

the class SwitchServiceImpl method getPortHistory.

@Override
public CompletableFuture<List<PortHistoryResponse>> getPortHistory(SwitchId switchId, int port, Instant from, Instant to) {
    PortHistoryRequest request = new PortHistoryRequest(switchId, port, from, to);
    Message message = new CommandMessage(request, System.currentTimeMillis(), RequestCorrelationId.getId());
    return messagingChannel.sendAndGetChunked(nbworkerTopic, message).thenApply(responses -> responses.stream().map(PortHistoryPayload.class::cast).map(switchMapper::map).collect(Collectors.toList()));
}
Also used : CommandMessage(org.openkilda.messaging.command.CommandMessage) Message(org.openkilda.messaging.Message) InfoMessage(org.openkilda.messaging.info.InfoMessage) PortHistoryRequest(org.openkilda.messaging.nbtopology.request.PortHistoryRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

Message (org.openkilda.messaging.Message)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 InfoMessage (org.openkilda.messaging.info.InfoMessage)1 PortHistoryRequest (org.openkilda.messaging.nbtopology.request.PortHistoryRequest)1