Search in sources :

Example 1 with NodeRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved in project openflowplugin by opendaylight.

the class NodeNotificationSupplierImpl method deleteNotification.

@Override
public NodeRemoved deleteNotification(final InstanceIdentifier<FlowCapableNode> path) {
    Preconditions.checkArgument(path != null);
    final NodeRemovedBuilder delNodeNotifBuilder = new NodeRemovedBuilder();
    delNodeNotifBuilder.setNodeRef(new NodeRef(path));
    return delNodeNotifBuilder.build();
}
Also used : NodeRef(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef) NodeRemovedBuilder(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder)

Example 2 with NodeRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved in project openflowplugin by opendaylight.

the class DeviceMastershipManager method onNodeRemoved.

@Override
public void onNodeRemoved(NodeRemoved notification) {
    LOG.debug("NodeRemoved notification received : {}", notification);
    NodeId nodeId = notification.getNodeRef().getValue().firstKeyOf(Node.class).getId();
    final DeviceMastership mastership = deviceMasterships.remove(nodeId);
    if (mastership != null) {
        mastership.close();
        LOG.info("Unregistered FRM cluster singleton service for service id : {}", nodeId.getValue());
    }
}
Also used : FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) NodeId(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)

Example 3 with NodeRemoved

use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved in project openflowplugin by opendaylight.

the class NodeNotificationSupplierImplTest method testDelete.

@Test
public void testDelete() {
    final NodeRemoved notification = notifSupplierImpl.deleteNotification(createTestFlowCapableNodePath());
    assertNotNull(notification);
    assertEquals(FLOW_NODE_ID, notification.getNodeRef().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
}
Also used : FlowCapableNode(org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode) Node(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node) NodeRemoved(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved) NodeKey(org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey) Test(org.junit.Test)

Aggregations

FlowCapableNode (org.opendaylight.yang.gen.v1.urn.opendaylight.flow.inventory.rev130819.FlowCapableNode)2 Node (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.Node)2 Test (org.junit.Test)1 NodeId (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeId)1 NodeRef (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRef)1 NodeRemoved (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemoved)1 NodeRemovedBuilder (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeRemovedBuilder)1 NodeKey (org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.nodes.NodeKey)1