use of org.openkilda.messaging.nbtopology.request.UpdateSwitchUnderMaintenanceRequest in project open-kilda by telstra.
the class SwitchServiceImpl method updateSwitchUnderMaintenance.
/**
* {@inheritDoc}
*/
@Override
public CompletableFuture<SwitchDto> updateSwitchUnderMaintenance(SwitchId switchId, UnderMaintenanceDto underMaintenanceDto) {
String correlationId = RequestCorrelationId.getId();
logger.debug("Update under maintenance flag for switch request processing");
UpdateSwitchUnderMaintenanceRequest data = new UpdateSwitchUnderMaintenanceRequest(switchId, underMaintenanceDto.isUnderMaintenance(), underMaintenanceDto.isEvacuate());
CommandMessage request = new CommandMessage(data, 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()).get(0));
}
Aggregations