Search in sources :

Example 1 with DeleteMeterResult

use of org.openkilda.northbound.dto.v1.switches.DeleteMeterResult in project open-kilda by telstra.

the class JsonSerializationTest method deleteMeterResultTest.

@Test
public void deleteMeterResultTest() throws IOException {
    DeleteMeterResult dto = new DeleteMeterResult(true);
    assertEquals(dto, pass(dto, DeleteMeterResult.class));
}
Also used : DeleteMeterResult(org.openkilda.northbound.dto.v1.switches.DeleteMeterResult) Test(org.junit.Test)

Example 2 with DeleteMeterResult

use of org.openkilda.northbound.dto.v1.switches.DeleteMeterResult in project open-kilda by telstra.

the class SwitchServiceImpl method deleteMeter.

@Override
public CompletableFuture<DeleteMeterResult> deleteMeter(SwitchId switchId, long meterId) {
    String requestId = RequestCorrelationId.getId();
    CommandMessage deleteCommand = new CommandMessage(new DeleteMeterRequest(switchId, meterId), System.currentTimeMillis(), requestId);
    return messagingChannel.sendAndGet(floodlightTopic, deleteCommand).thenApply(DeleteMeterResponse.class::cast).thenApply(response -> new DeleteMeterResult(response.isDeleted()));
}
Also used : DeleteMeterRequest(org.openkilda.messaging.command.flow.DeleteMeterRequest) DeleteMeterResult(org.openkilda.northbound.dto.v1.switches.DeleteMeterResult) CommandMessage(org.openkilda.messaging.command.CommandMessage)

Aggregations

DeleteMeterResult (org.openkilda.northbound.dto.v1.switches.DeleteMeterResult)2 Test (org.junit.Test)1 CommandMessage (org.openkilda.messaging.command.CommandMessage)1 DeleteMeterRequest (org.openkilda.messaging.command.flow.DeleteMeterRequest)1