public TopologyNodeState(final DataBroker broker, final InstanceIdentifier<Topology> topology, final NodeId id, final long holdStateNanos) { Preconditions.checkArgument(holdStateNanos >= 0); this.nodeId = topology.child(Node.class, new NodeKey(id)); this.holdStateNanos = holdStateNanos; this.chain = broker.createTransactionChain(this); }
@Override public void init(@Nonnull final NodeId id, @Nonnull final Node operationalDataNode) { // put into Datastore final WriteTransaction wTx = transactionChain.newWriteOnlyTransaction(); wTx.put(LogicalDatastoreType.OPERATIONAL, TopologyUtil.createTopologyNodeListPath(new NodeKey(id), topologyId), operationalDataNode); commitTransaction(wTx, id, "init"); }
protected InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node> provideIIToTopologyNode( final NodeId nodeIdInTopology) { org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey nodeKeyInTopology = new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey( nodeIdInTopology); return II_TO_TOPOLOGY .builder() .child(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.class, nodeKeyInTopology).build(); }
@Override public void delete(@Nonnull final NodeId id) { // delete final WriteTransaction wTx = transactionChain.newWriteOnlyTransaction(); wTx.delete(LogicalDatastoreType.OPERATIONAL, TopologyUtil.createTopologyNodeListPath(new NodeKey(id), topologyId)); commitTransaction(wTx, id, "delete"); }
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((NodeId) 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); } }
TpReader(final ReadTransaction t, final InstanceIdentifier<Topology> topo, final TpReference ref) { this.t = Preconditions.checkNotNull(t); this.nii = topo.child(Node.class, new NodeKey(ref.getNode())); this.tii = this.nii.child(TerminationPoint.class, new TerminationPointKey(ref.getTp())); }
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) { return InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) .child(Node.class,new NodeKey(nodeId)); }
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) { return InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) .child(Node.class,new NodeKey(nodeId)); }
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) { return InstanceIdentifier .create(NetworkTopology.class) .child(Topology.class, new TopologyKey(OVSDB_TOPOLOGY_ID)) .child(Node.class,new NodeKey(nodeId)); }
public static InstanceIdentifier<Node> buildNodePath(InstanceIdentifier<Topology> topoPath, String nodeName) { NodeId nodeId = new NodeId(nodeName); NodeKey nodeKey = new NodeKey(nodeId); InstanceIdentifierBuilder<Topology> topoPathBuilder = topoPath.builder(); InstanceIdentifierBuilder<Node> nodePathBuilder = topoPathBuilder.child(Node.class, nodeKey); return nodePathBuilder.build(); }
public static InstanceIdentifier<Node> createNodePath(TopologyId topoId, NodeId nodeId) { return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(topoId)) .child(Node.class, new NodeKey(nodeId)); }
NodeImpl(NodeBuilder base) { if (base.key() != null) { this.key = base.key(); } else { this.key = new NodeKey(base.getNodeId()); } this._nodeId = key.getNodeId(); this._supportingNode = base.getSupportingNode(); this._terminationPoint = base.getTerminationPoint(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
private static NodeBuilder getNodeIdBuilder(final RemoteDeviceId id) { final NodeBuilder nodeBuilder = new NodeBuilder(); nodeBuilder.setKey(new NodeKey(new NodeId(id.getName()))); return nodeBuilder; }
public static Optional<Node> sourceNode(final ReadTransaction t, final InstanceIdentifier<Topology> topology, final Link link) throws ReadFailedException { return t.read(LogicalDatastoreType.OPERATIONAL, topology.child(Node.class, new NodeKey(link.getSource().getSourceNode()))).checkedGet(); } }
public static InstanceIdentifier<Node> createNodeIId(String topoId, NodeId nodeId) { return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(new TopologyId(topoId))) .child(Node.class, new NodeKey(nodeId)); }
public static InstanceIdentifier<Node> createNodeIId(FabricId topoId, NodeId nodeId) { return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(new TopologyId(topoId))) .child(Node.class, new NodeKey(nodeId)); }
private InstanceIdentifier<Node> getMountpointIid(Node node) { return InstanceIdentifier.builder(NetworkTopology.class) .child(Topology.class, new TopologyKey(TOPOLOGY_ID)) .child(Node.class, new NodeKey(node.getNodeId())) .build(); }
public static InstanceIdentifier<TerminationPoint> createLogicPortIId(FabricId fabricId, NodeId nodeId, TpId tpid) { return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(new TopologyId(fabricId))) .child(Node.class, new NodeKey(nodeId)) .child(TerminationPoint.class, new TerminationPointKey(new TpId(tpid))); }
private InstanceIdentifier<SupportingNode> createSuplNodeIId(DeviceKey key) { return InstanceIdentifier.create(NetworkTopology.class) .child(Topology.class, new TopologyKey(new TopologyId(this.fabricid.getValue()))) .child(Node.class, new NodeKey(this.nodeid)) .child(SupportingNode.class, new SupportingNodeKey(key.getNodeId(), key.getTopoId())); } }
private static InstanceIdentifier<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node> createBindingPathForTopology(final NodeKey key) { final InstanceIdentifier<NetworkTopology> networkTopology = InstanceIdentifier.builder(NetworkTopology.class).build(); final KeyedInstanceIdentifier<Topology, TopologyKey> topology = networkTopology.child(Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName()))); return topology .child(org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node.class, new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey (new org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId(key.getId().getValue()))); }