Search in sources :

Example 1 with MeterRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved in project openflowplugin by opendaylight.

the class MeterNotificationSupplierImplTest method testDelete.

@Test
public void testDelete() {
    final MeterRemoved notification = notifSupplierImpl.deleteNotification(createTestMeterPath());
    assertNotNull(notification);
    assertEquals(METER_ID, notification.getMeterId().getValue());
    assertEquals(METER_ID, notification.getMeterRef().getValue().firstKeyOf(Meter.class, MeterKey.class).getMeterId().getValue());
    assertEquals(FLOW_NODE_ID, notification.getNode().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
}
Also used : MeterKey(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey) MeterRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved) Meter(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter) FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) Test(org.junit.Test)

Example 2 with MeterRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved in project openflowplugin by opendaylight.

the class MeterNotificationSupplierImpl method deleteNotification.

@Override
public MeterRemoved deleteNotification(final InstanceIdentifier<Meter> path) {
    Preconditions.checkArgument(path != null);
    final MeterRemovedBuilder builder = new MeterRemovedBuilder();
    builder.setMeterId(path.firstKeyOf(Meter.class, MeterKey.class).getMeterId());
    builder.setMeterRef(new MeterRef(path));
    builder.setNode(createNodeRef(path));
    return builder.build();
}
Also used : MeterRemovedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemovedBuilder) MeterRef(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef)

Aggregations

Test (org.junit.Test)1 FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)1 Meter (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter)1 MeterKey (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.MeterKey)1 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)1 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)1 MeterRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemoved)1 MeterRemovedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterRemovedBuilder)1 MeterRef (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef)1