Search in sources :

Example 1 with MeterUpdated

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

the class MeterNotificationSupplierImplTest method testUpdate.

@Test
public void testUpdate() {
    final MeterUpdated notification = notifSupplierImpl.updateNotification(createTestMeter(), 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) Meter(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.meters.Meter) MeterUpdated(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdated) 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 MeterUpdated

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

the class MeterNotificationSupplierImpl method updateNotification.

@Override
public MeterUpdated updateNotification(final Meter meter, final InstanceIdentifier<Meter> path) {
    Preconditions.checkArgument(meter != null);
    Preconditions.checkArgument(path != null);
    final MeterUpdatedBuilder builder = new MeterUpdatedBuilder(meter);
    builder.setMeterRef(new MeterRef(path));
    builder.setNode(createNodeRef(path));
    return builder.build();
}
Also used : MeterRef(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef) MeterUpdatedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdatedBuilder)

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 MeterUpdated (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdated)1 MeterUpdatedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.service.rev130918.MeterUpdatedBuilder)1 MeterRef (org.opendaylight.yang.gen.v1.urn.opendaylight.meter.types.rev130918.MeterRef)1