use of org.openkilda.messaging.nbtopology.response.GetSwitchResponse in project open-kilda by telstra.
the class SwitchServiceImpl method getSwitches.
/**
* {@inheritDoc}
*/
@Override
public CompletableFuture<List<SwitchDto>> getSwitches() {
final String correlationId = RequestCorrelationId.getId();
logger.debug("Get switch request received");
CommandMessage request = new CommandMessage(new GetSwitchesRequest(), System.currentTimeMillis(), correlationId);
return messagingChannel.sendAndGetChunked(nbworkerTopic, request).thenApply(messages -> messages.stream().map(GetSwitchResponse.class::cast).map(GetSwitchResponse::getPayload).map(switchMapper::toSwitchDto).collect(Collectors.toList()));
}
Aggregations