private List<SupportingNode> createDefaultSuplNode(FabricId fabricid) { SupportingNodeBuilder builder = new SupportingNodeBuilder(); builder.setNodeRef(fabricid); builder.setKey(new SupportingNodeKey(fabricid, new TopologyId(Constants.FABRICS_TOPOLOGY_ID))); return Lists.newArrayList(builder.build()); }
SupportingNodeImpl(SupportingNodeBuilder base) { if (base.key() != null) { this.key = base.key(); } else { this.key = new SupportingNodeKey(base.getNodeRef(), base.getTopologyRef()); } this._nodeRef = key.getNodeRef(); this._topologyRef = key.getTopologyRef(); this.augmentation = ImmutableMap.copyOf(base.augmentation); }
public SupportingNodeBuilder addAugmentation(java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode>> augmentationType, Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode> augmentation) { if (augmentation == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentation); return this; }
private SupportingNodeImpl(SupportingNodeBuilder base) { if (base.getKey() == null) { this._key = new SupportingNodeKey( base.getNodeRef(), base.getTopologyRef() ); this._nodeRef = base.getNodeRef(); this._topologyRef = base.getTopologyRef(); } else { this._key = base.getKey(); this._nodeRef = _key.getNodeRef(); this._topologyRef = _key.getTopologyRef(); } switch (base.augmentation.size()) { case 0: this.augmentation = Collections.emptyMap(); break; case 1: final Map.Entry<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode>>, Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode>> e = base.augmentation.entrySet().iterator().next(); this.augmentation = Collections.<java.lang.Class<? extends Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode>>, Augmentation<org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.node.attributes.SupportingNode>>singletonMap(e.getKey(), e.getValue()); break; default : this.augmentation = new HashMap<>(base.augmentation); } }
private static NodeBuilder createBasicVppNodeBuilder(NodeId nodeId) { return new NodeBuilder().setNodeId(nodeId).setSupportingNode(Arrays.asList( new SupportingNodeBuilder().setTopologyRef(SUPPORTING_TOPOLOGY_NETCONF).setNodeRef(nodeId).build())); }
public SupportingNodeBuilder addAugmentation(Class<? extends Augmentation<SupportingNode>> augmentationType, Augmentation<SupportingNode> augmentationValue) { if (augmentationValue == null) { return removeAugmentation(augmentationType); } if (!(this.augmentation instanceof HashMap)) { this.augmentation = new HashMap<>(); } this.augmentation.put(augmentationType, augmentationValue); return this; }
private SupportingNode createSupportingNode(final NodeId sni, final Boolean inControl) { final SupportingNodeKey sk = new SupportingNodeKey(sni, this.source); final SupportingNodeBuilder snb = new SupportingNodeBuilder(); snb.setNodeRef(sni); snb.setKey(sk); snb.addAugmentation(SupportingNode1.class, new SupportingNode1Builder().setPathComputationClient( new PathComputationClientBuilder().setControlling(inControl).build()).build()); return snb.build(); }
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); } }
final InstanceIdentifier<SupportingNode> suplNodeIid = MdSalUtils.createFNodeIId(input.getFabricId()) .child(SupportingNode.class, new SupportingNodeKey(deviceid, topoid)); SupportingNodeBuilder suplNodeBuilder = new SupportingNodeBuilder(); suplNodeBuilder.setNodeRef(deviceid); suplNodeBuilder.setTopologyRef(topoid); suplNodeBuilder.setKey(new SupportingNodeKey(deviceid, topoid)); trans.put(LogicalDatastoreType.OPERATIONAL, suplNodeIid, suplNodeBuilder.build(), true);