use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method removeTp.
private void removeTp(final WriteTransaction trans, final NodeId node, final TpId tp, final LinkId link, final boolean isRemote) {
final NodeHolder nh = this.nodes.get(node);
if (nh != null) {
final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(new NodeKey(nh.getNodeId()));
trans.delete(LogicalDatastoreType.OPERATIONAL, nid.child(TerminationPoint.class, new TerminationPointKey(tp)));
nh.removeTp(tp, link, isRemote);
checkNodeForRemoval(trans, nh);
} else {
LOG.warn("Removed non-existent node {}", node);
}
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project bgpcep by opendaylight.
the class LinkstateTopologyBuilder method removePrefix.
private void removePrefix(final WriteTransaction trans, final UriBuilder base, final PrefixCase prefixCase) {
final NodeId node = buildNodeId(base, prefixCase.getAdvertisingNodeDescriptors());
final NodeHolder nh = this.nodes.get(node);
if (nh != null) {
LOG.debug("Removed prefix {}", prefixCase);
final InstanceIdentifier<Node> nid = getNodeInstanceIdentifier(new NodeKey(nh.getNodeId()));
final InstanceIdentifier<IgpNodeAttributes> inaId = nid.builder().augmentation(Node1.class).child(IgpNodeAttributes.class).build();
final IpPrefix ippfx = prefixCase.getPrefixDescriptors().getIpReachabilityInformation();
if (ippfx == null) {
LOG.warn("IP reachability not present in prefix {}, skipping it", prefixCase);
return;
}
final PrefixKey pk = new PrefixKey(ippfx);
trans.delete(LogicalDatastoreType.OPERATIONAL, inaId.child(Prefix.class, pk));
nh.removePrefix(prefixCase);
checkNodeForRemoval(trans, nh);
} else {
LOG.warn("Removing prefix from non-existing node {}", node);
}
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class AbstractNotificationSupplierBase method getNodeII.
/**
* Method returns a keyed {@link InstanceIdentifier} for {@link Node} from inventory
* because this path is a base for every OF paths.
*
* @param ii - key for keyed {@link Node} {@link InstanceIdentifier}
* @return Keyed InstanceIdentifier for Node
*/
protected static KeyedInstanceIdentifier<Node, NodeKey> getNodeII(final InstanceIdentifier<?> ii) {
final NodeKey key = ii.firstKeyOf(Node.class, NodeKey.class);
Preconditions.checkArgument(key != null);
return InstanceIdentifier.create(Nodes.class).child(Node.class, key);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class SimplifiedOperationalListenerTest method setUp.
@Before
public void setUp() throws Exception {
final DataBroker db = Mockito.mock(DataBroker.class);
final FlowCapableNodeSnapshotDao configSnapshot = new FlowCapableNodeSnapshotDao();
final FlowCapableNodeSnapshotDao operationalSnapshot = new FlowCapableNodeSnapshotDao();
final FlowCapableNodeDao configDao = new FlowCapableNodeCachedDao(configSnapshot, new FlowCapableNodeOdlDao(db, LogicalDatastoreType.CONFIGURATION));
nodeListenerOperational = new SimplifiedOperationalListener(reactor, operationalSnapshot, configDao, reconciliationRegistry, deviceMastershipManager);
InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(NODE_ID));
fcNodePath = nodePath.augmentation(FlowCapableNode.class);
final DataTreeIdentifier<Node> dataTreeIdentifier = new DataTreeIdentifier<>(LogicalDatastoreType.OPERATIONAL, nodePath);
Mockito.when(db.newReadOnlyTransaction()).thenReturn(roTx);
Mockito.when(operationalNode.getId()).thenReturn(NODE_ID);
Mockito.when(dataTreeModification.getRootPath()).thenReturn(dataTreeIdentifier);
Mockito.when(dataTreeModification.getRootNode()).thenReturn(operationalModification);
Mockito.when(operationalNode.getAugmentation(FlowCapableNode.class)).thenReturn(fcOperationalNode);
}
use of org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey in project openflowplugin by opendaylight.
the class SyncReactorClusterDecoratorTest method setUp.
@Before
public void setUp() {
reactor = new SyncReactorClusterDecorator(delegate, deviceMastershipManager);
InstanceIdentifier<Node> nodePath = InstanceIdentifier.create(Nodes.class).child(Node.class, new NodeKey(NODE_ID));
fcNodePath = nodePath.augmentation(FlowCapableNode.class);
}
Aggregations