Search in sources :

Example 1 with GetSwitchPropertiesRequest

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

the class SwitchServiceImpl method getSwitchProperties.

@Override
public CompletableFuture<SwitchPropertiesDto> getSwitchProperties(SwitchId switchId) {
    final String correlationId = RequestCorrelationId.getId();
    logger.debug("Get switch properties for the switch: {}", switchId);
    GetSwitchPropertiesRequest data = new GetSwitchPropertiesRequest(switchId);
    CommandMessage message = new CommandMessage(data, System.currentTimeMillis(), correlationId);
    return messagingChannel.sendAndGet(nbworkerTopic, message).thenApply(SwitchPropertiesResponse.class::cast).thenApply(response -> switchMapper.map(response.getSwitchProperties()));
}
Also used : GetSwitchPropertiesRequest(org.openkilda.messaging.nbtopology.request.GetSwitchPropertiesRequest) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

CommandMessage (org.openkilda.messaging.command.CommandMessage)1 GetSwitchPropertiesRequest (org.openkilda.messaging.nbtopology.request.GetSwitchPropertiesRequest)1