public static NodeKey createNodeKey(IpAddress ip, PortNumber port) { return new NodeKey(createNodeId(ip, port)); }
/** * Gets the node id. * * @param identifier * the identifier * @return the node id */ private NodeId getNodeId(InstanceIdentifier<PhysicalSwitchAugmentation> identifier) { return identifier.firstKeyOf(Node.class).getNodeId(); }
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); }
public static InstanceIdentifier<Node> createFNodeIId(FabricId fabricId) { return Constants.DOM_FABRICS_PATH.child(Node.class, new NodeKey(fabricId)); }
/** * Return the node ID in the specified instance identifier. * * @param iid instance of InstanceIdentifier. * @return NodeId of the Controller. */ private NodeId getNodeId(InstanceIdentifier<Node> iid) { NodeKey nodeKey = iid.firstKeyOf(Node.class); return nodeKey.getNodeId(); }
private void buildNodeAttribute(NodeBuilder builder, ComposeFabricInput input, FabricId fabricId) { builder.setKey(new NodeKey(fabricId)); List<DeviceNodes> devices = input.getDeviceNodes(); if (devices != null) { List<SupportingNode> snodes = Lists.newArrayList(); for (DeviceNodes device : devices) { InstanceIdentifier<?> nodeRef = device.getDeviceRef().getValue(); NodeId nodeid = nodeRef.firstKeyOf(Node.class).getNodeId(); TopologyId topoId = nodeRef.firstKeyOf(Topology.class).getTopologyId(); SupportingNodeBuilder snodeBuilder = new SupportingNodeBuilder(); snodeBuilder.setNodeRef(nodeid); snodeBuilder.setTopologyRef(topoId); snodeBuilder.setKey(new SupportingNodeKey(nodeid, topoId)); snodes.add(snodeBuilder.build()); } builder.setSupportingNode(snodes); } }
private InstanceIdentifier<Node> getNodePath(final NodeId nodeId) { return iiToTopology.child(Node.class, new NodeKey(nodeId)); }
public static NodeId createManagedNodeId(InstanceIdentifier<Node> iid) { NodeKey nodeKey = iid.firstKeyOf(Node.class, NodeKey.class); return nodeKey.getNodeId(); }
/** * Create the {@link InstanceIdentifier} for the {@link ManagerEntry}. * * @param managerEntry the {@link ManagerEntry} * @return the {@link InstanceIdentifier} */ private InstanceIdentifier<ManagerEntry> getManagerEntryIid(ManagerEntry managerEntry) { OvsdbConnectionInstance client = getOvsdbConnectionInstance(); String nodeString = client.getNodeKey().getNodeId().getValue(); NodeId nodeId = new NodeId(new Uri(nodeString)); NodeKey nodeKey = new NodeKey(nodeId); InstanceIdentifier<Node> ovsdbNodeIid = InstanceIdentifier.builder(NetworkTopology.class) .child(Topology.class,new TopologyKey(SouthboundConstants.OVSDB_TOPOLOGY_ID)) .child(Node.class,nodeKey) .build(); return ovsdbNodeIid .augmentation(OvsdbNodeAugmentation.class) .child(ManagerEntry.class, managerEntry.getKey()); }
private InstanceIdentifier<Node> nodeIdentifier(final NodeId node) { return this.target.child(Node.class, new NodeKey(node)); }
public static NodeId createManagedNodeId(InstanceIdentifier<Node> iid) { NodeKey nodeKey = iid.firstKeyOf(Node.class, NodeKey.class); return nodeKey.getNodeId(); }
private InstanceIdentifier<TerminationPoint> createTP(final IpAddress addr, final InstanceIdentifier<Node> sni, final Boolean inControl, final ReadWriteTransaction trans) { final String url = "ip://" + addr.toString(); final TerminationPointKey tpk = new TerminationPointKey(new TpId(url)); final TerminationPointBuilder tpb = new TerminationPointBuilder(); tpb.setKey(tpk).setTpId(tpk.getTpId()); tpb.addAugmentation(TerminationPoint1.class, new TerminationPoint1Builder().setIgpTerminationPointAttributes( new IgpTerminationPointAttributesBuilder().setTerminationPointType( new IpBuilder().setIpAddress(Lists.newArrayList(addr)).build()).build()).build()); final NodeKey nk = new NodeKey(new NodeId(url)); final NodeBuilder nb = new NodeBuilder(); nb.setKey(nk).setNodeId(nk.getNodeId()); nb.setTerminationPoint(Lists.newArrayList(tpb.build())); if (sni != null) { nb.setSupportingNode(Lists.newArrayList(createSupportingNode(InstanceIdentifier.keyOf(sni).getNodeId(), inControl))); } final InstanceIdentifier<Node> nid = this.target.child(Node.class, nb.getKey()); trans.put(LogicalDatastoreType.OPERATIONAL, nid, nb.build()); return nid.child(TerminationPoint.class, tpb.getKey()); }
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); }
public static NodeId createManagedNodeId(InstanceIdentifier<Node> iid) { NodeKey nodeKey = iid.firstKeyOf(Node.class); return nodeKey.getNodeId(); }
public static InstanceIdentifier<Node> createInstanceIdentifier(NodeId nodeId) { return createTopologyInstanceIdentifier() .child(Node.class,new NodeKey(nodeId)); }
public static NodeId createManagedNodeId(InstanceIdentifier<Node> iid) { NodeKey nodeKey = iid.firstKeyOf(Node.class, NodeKey.class); return nodeKey.getNodeId(); }
public static InstanceIdentifier<FabricNode> createFabricIId(FabricId fabricId) { return Constants.DOM_FABRICS_PATH.child(Node.class, new NodeKey(fabricId)) .augmentation(FabricNode.class); }
public static NodeId getNodeId(InstanceIdentifier<TerminationPoint> iid) { return iid.firstKeyOf(Node.class).getNodeId(); }
private KeyedInstanceIdentifier<Node, NodeKey> nodeInstanceId(final NodeId ni) { return getInstanceIdentifier().child(Node.class, new NodeKey(ni)); }