use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved in project openflowplugin by opendaylight.
the class NodeConnectorInventoryEventTranslatorTest method testNodeConnectorUpdateToLinkDown.
/**
* Test that checks if {@link NodeConnectorEventsObserver#nodeConnectorRemoved} is called
* for each FlowCapableNodeConnector item that have link down state removed in
* {@link org.opendaylight.controller.md.sal.binding.api.DataTreeModification}.
*/
@Test
public void testNodeConnectorUpdateToLinkDown() {
FlowCapableNodeConnector fcnc = TestUtils.createFlowCapableNodeConnector(true, false).build();
DataTreeModification dataTreeModification = setupDataTreeChange(SUBTREE_MODIFIED, NODE_CONNECTOR_INSTANCE_IDENTIFIER, fcnc);
translator.onDataTreeChanged(Collections.singleton(dataTreeModification));
verify(eventsObserver).nodeConnectorRemoved(ID);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved in project openflowplugin by opendaylight.
the class NodeConnectorInventoryEventTranslatorTest method testNodeConnectorUpdateToAdminDown.
/**
* Test that checks if {@link NodeConnectorEventsObserver#nodeConnectorRemoved} is called
* for each FlowCapableNodeConnector item with administrative down state removed in
* {@link org.opendaylight.controller.md.sal.binding.api.DataTreeModification}.
*/
@Test
public void testNodeConnectorUpdateToAdminDown() {
FlowCapableNodeConnector fcnc = TestUtils.createFlowCapableNodeConnector(false, true).build();
DataTreeModification dataTreeModification = setupDataTreeChange(SUBTREE_MODIFIED, NODE_CONNECTOR_INSTANCE_IDENTIFIER, fcnc);
translator.onDataTreeChanged(Collections.singleton(dataTreeModification));
verify(eventsObserver).nodeConnectorRemoved(ID);
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved in project openflowplugin by opendaylight.
the class NodeConnectorNotificationSupplierImpl method deleteNotification.
@Override
public NodeConnectorRemoved deleteNotification(final InstanceIdentifier<FlowCapableNodeConnector> path) {
Preconditions.checkArgument(path != null);
final NodeConnectorRemovedBuilder notifBuilder = new NodeConnectorRemovedBuilder();
notifBuilder.setNodeConnectorRef(new NodeConnectorRef(path));
return notifBuilder.build();
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved in project openflowplugin by opendaylight.
the class NodeConnectorNotificationSupplierImplTest method testDelete.
@Test
public void testDelete() {
final NodeConnectorRemoved notification = notifSupplierImpl.deleteNotification(createTestFlowCapableConnectorNodePath());
assertNotNull(notification);
assertEquals(FLOW_CODE_CONNECTOR_ID, notification.getNodeConnectorRef().getValue().firstKeyOf(NodeConnector.class, NodeConnectorKey.class).getId().getValue());
assertEquals(FLOW_NODE_ID, notification.getNodeConnectorRef().getValue().firstKeyOf(Node.class, NodeKey.class).getId().getValue());
}
use of org.opendaylight.yang.gen.v1.urn.opendaylight.inventory.rev130819.NodeConnectorRemoved in project openflowplugin by opendaylight.
the class LLDPSpeaker method nodeConnectorRemoved.
@Override
public void nodeConnectorRemoved(final InstanceIdentifier<NodeConnector> nodeConnectorInstanceId) {
Preconditions.checkNotNull(nodeConnectorInstanceId);
nodeConnectorMap.remove(nodeConnectorInstanceId);
NodeConnectorId nodeConnectorId = InstanceIdentifier.keyOf(nodeConnectorInstanceId).getId();
LOG.trace("Port removed from node-connector map : {}", nodeConnectorId.getValue());
}
Aggregations