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