use of org.openkilda.northbound.dto.v1.switches.PortDto in project open-kilda by telstra.
the class SwitchServiceImpl method configurePort.
/**
* {@inheritDoc}
*/
@Override
public CompletableFuture<PortDto> configurePort(SwitchId switchId, int port, PortConfigurationPayload config) {
String correlationId = RequestCorrelationId.getId();
PortConfigurationRequest request = new PortConfigurationRequest(switchId, port, toPortAdminDown(config.getStatus()));
CommandMessage updateStatusCommand = new CommandMessage(request, System.currentTimeMillis(), correlationId, Destination.CONTROLLER);
return messagingChannel.sendAndGet(floodlightTopic, updateStatusCommand).thenApply(PortConfigurationResponse.class::cast).thenApply(response -> new PortDto(response.getSwitchId().toString(), response.getPortNo()));
}
Aggregations