Search in sources :

Example 1 with DeleteSwitchRequest

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

the class SwitchServiceImpl method deleteSwitch.

/**
 * {@inheritDoc}
 */
@Override
public CompletableFuture<DeleteSwitchResult> deleteSwitch(SwitchId switchId, boolean force) {
    String correlationId = RequestCorrelationId.getId();
    CommandMessage deleteCommand = new CommandMessage(new DeleteSwitchRequest(switchId, force), System.currentTimeMillis(), correlationId, Destination.WFM);
    return messagingChannel.sendAndGet(nbworkerTopic, deleteCommand).thenApply(DeleteSwitchResponse.class::cast).thenApply(response -> new DeleteSwitchResult(response.isDeleted()));
}
Also used : DeleteSwitchResult(org.openkilda.northbound.dto.v1.switches.DeleteSwitchResult) CommandMessage(org.openkilda.messaging.command.CommandMessage) DeleteSwitchRequest(org.openkilda.messaging.nbtopology.request.DeleteSwitchRequest)

Aggregations

CommandMessage (org.openkilda.messaging.command.CommandMessage)1 DeleteSwitchRequest (org.openkilda.messaging.nbtopology.request.DeleteSwitchRequest)1 DeleteSwitchResult (org.openkilda.northbound.dto.v1.switches.DeleteSwitchResult)1