Search in sources :

Example 1 with UpdatePortPropertiesRequest

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

the class SwitchServiceImpl method updatePortProperties.

@Override
public CompletableFuture<PortPropertiesResponse> updatePortProperties(SwitchId switchId, int port, PortPropertiesDto portPropertiesDto) {
    String correlationId = RequestCorrelationId.getId();
    logger.info("Update port properties for the switch {} and port {}. New properties {}", switchId, port, portPropertiesDto);
    UpdatePortPropertiesRequest data = new UpdatePortPropertiesRequest(switchId, port, portPropertiesDto.isDiscoveryEnabled());
    InfoMessage request = new InfoMessage(data, System.currentTimeMillis(), correlationId);
    return messagingChannel.sendAndGet(topoDiscoTopic, request).thenApply(PortPropertiesPayload.class::cast).thenApply(portPropertiesMapper::map);
}
Also used : UpdatePortPropertiesRequest(org.openkilda.messaging.nbtopology.request.UpdatePortPropertiesRequest) InfoMessage(org.openkilda.messaging.info.InfoMessage)

Aggregations

InfoMessage (org.openkilda.messaging.info.InfoMessage)1 UpdatePortPropertiesRequest (org.openkilda.messaging.nbtopology.request.UpdatePortPropertiesRequest)1