2 * Copyright © 2017 AT&T and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.transportpce.renderer.mapping;
11 import com.google.common.base.Optional;
12 import com.google.common.util.concurrent.CheckedFuture;
14 import java.util.ArrayList;
15 import java.util.List;
16 import java.util.concurrent.ExecutionException;
18 import org.opendaylight.controller.md.sal.binding.api.DataBroker;
19 import org.opendaylight.controller.md.sal.binding.api.MountPoint;
20 import org.opendaylight.controller.md.sal.binding.api.MountPointService;
21 import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
22 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
23 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
24 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
25 import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaces;
26 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.NodeTypes;
27 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.Ports;
28 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.PortsKey;
29 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
30 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
31 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.degree.ConnectionPorts;
32 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
33 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
34 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
35 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Info;
36 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
37 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
38 import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
39 import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
40 import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
41 import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
42 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf;
43 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
44 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.NetworkBuilder;
45 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.Nodes;
46 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesBuilder;
47 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.NodesKey;
48 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.Mapping;
49 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingBuilder;
50 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingKey;
51 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NetworkTopology;
52 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
53 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.TopologyId;
54 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.Topology;
55 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.TopologyKey;
56 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
57 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.NodeKey;
58 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
59 import org.slf4j.Logger;
60 import org.slf4j.LoggerFactory;
62 public class PortMapping {
64 private static final Logger LOG = LoggerFactory.getLogger(PortMapping.class);
65 private final DataBroker db;
66 private final MountPointService mps;
67 private final String nodeId;
69 public PortMapping(DataBroker db, MountPointService mps, String nodeId) {
77 * This method creates logical to physical port mapping for a given device.
78 * Instead of parsing all the circuit packs/ports in the device this methods
79 * does a selective read operation on degree/srg subtree to get circuit
80 * packs/ports that map to :
83 * 1. DEGn-TTP-TX, DEGn-TTP-RX, DEGn-TTP-TXRX
86 * 2. SRGn-PPp-TX, SRGn-PPp-RX, SRGn-PPp-TXRX
95 * If the port is Mw it also store the OMS, OTS interface provisioned on the
96 * port. It skips the logical ports that are internal. If operation is
97 * successful the mapping gets stored in datastore corresponding to
98 * portmapping.yang data model.
100 * @return true/false based on status of operation
102 public boolean createMappingData() {
104 LOG.info("Create Mapping Data for node " + nodeId);
105 DataBroker deviceDb = getDeviceDataBroker(nodeId, mps);
106 List<Mapping> portMapList = new ArrayList<>();
108 Integer nodeType = 1;
109 if (deviceDb != null) {
110 deviceInfo = getDeviceInfo(deviceDb);
111 if (deviceInfo != null) {
112 if (deviceInfo.getNodeType() == null) {
113 LOG.info("Node type mandatory field is missing");
116 nodeType = deviceInfo.getNodeType().getIntValue();
117 // Create Mapping for Roadm Node
119 // Get TTP port mapping
120 if (!createTtpPortMapping(deviceDb, deviceInfo, portMapList)) {
121 // return false if mapping creation for TTP's failed
122 LOG.info("Unable to create mapping for TTP's");
126 // Get PP port mapping
127 if (!createPpPortMapping(deviceDb, deviceInfo, portMapList)) {
128 // return false if mapping creation for PP's failed
129 LOG.info("Unable tp create mapping for PP's");
133 // Create Mapping for Xponder Node
135 if (!createXpdrPortMapping(deviceDb, deviceInfo, portMapList)) {
136 LOG.info("Unable to create mapping for Xponder");
141 LOG.info("Device info subtree is absent for " + nodeId);
146 LOG.info("Unable to get Data broker for node " + nodeId);
149 return postPortMapping(deviceInfo, portMapList, nodeType);
153 * This private method gets the list of external ports on a degree. For each
154 * port in the degree, it does a get on port subtree with
155 * circuit-pack-name/port-name as key in order to get the logical connection
156 * point name corresponding to it.
159 * Reference to device's databroker
161 * Info subtree read from the device
163 * Reference to the list containing the mapping to be pushed to
166 * @return true/false based on status of operation
168 private boolean createTtpPortMapping(DataBroker deviceDb, Info deviceInfo, List<Mapping> portMapList) {
169 // Creating mapping data for degree TTP's
170 List<ConnectionPorts> degreeConPorts = getDegreePorts(deviceDb, deviceInfo);
172 // Getting circuit-pack-name/port-name corresponding to TTP's
173 for (ConnectionPorts cp : degreeConPorts) {
174 String circuitPackName = cp.getCircuitPackName();
175 String portName = cp.getPortName().toString();
176 InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
177 CircuitPacks.class, new CircuitPacksKey(circuitPackName)).child(Ports.class, new PortsKey(portName));
179 LOG.info("Fetching logical Connection Point value for port " + portName + " at circuit pack "
181 ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
182 Optional<Ports> portObject = rtx.read(LogicalDatastoreType.OPERATIONAL, portIID).get();
183 if (portObject.isPresent()) {
184 Ports port = portObject.get();
185 if (port.getLogicalConnectionPoint() != null) {
187 LOG.info("Logical Connection Point for " + circuitPackName + " " + portName + " is " + port
188 .getLogicalConnectionPoint());
189 portMapList.add(createMappingObject(port, circuitPackName, port.getLogicalConnectionPoint(),
193 LOG.warn("Logical Connection Point value missing for " + circuitPackName + " " + port
197 } catch (InterruptedException | ExecutionException ex) {
198 LOG.warn("Read failed for Logical Connection Point value missing for " + circuitPackName + " "
207 * This private method gets the list of circuit packs on an Srg. For each
208 * circuit pack on an Srg, it does a get on circuit-pack subtree with
209 * circuit-pack-name as key in order to get the list of ports. It then
210 * iterates over the list of ports to get ports with port-qual as
211 * roadm-external. It appends a TX,RX,TXRX to the logical connection point
212 * name based on the direction of the port.
215 * Reference to device's databroker
217 * Info subtree read from the device
219 * Reference to the list containing the mapping to be pushed to
222 * @return true/false based on status of operation
225 private boolean createPpPortMapping(DataBroker deviceDb, Info deviceInfo, List<Mapping> portMapList) {
226 // Creating mapping data for degree PP's
227 List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps = getSrgCps(
228 deviceDb, deviceInfo);
230 for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks cps : srgCps) {
231 String circuitPackName = cps.getCircuitPackName();
233 InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
234 CircuitPacks.class, new CircuitPacksKey(circuitPackName));
235 ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
236 Optional<CircuitPacks> circuitPackObject = rtx.read(LogicalDatastoreType.OPERATIONAL, cpIID).get();
238 if (circuitPackObject.isPresent()) {
239 CircuitPacks cp = circuitPackObject.get();
240 if (!cp.getPorts().isEmpty()) {
241 for (Ports port : cp.getPorts()) {
243 if (port.getLogicalConnectionPoint() != null && port.getPortQual().getIntValue() == 2) {
244 String logicalConnectionPoint = null;
245 if (port.getPortDirection().getIntValue() == 1) {
246 // Port direction is transmit
247 logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TX";
249 if (port.getPortDirection().getIntValue() == 2) {
250 // Port direction is receive
251 logicalConnectionPoint = port.getLogicalConnectionPoint() + "-RX";
253 if (port.getPortDirection().getIntValue() == 3) {
254 // port is bi-directional
255 logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TXRX";
258 LOG.info("Logical Connection Point for " + circuitPackName + " " + port.getPortName()
259 + " is " + logicalConnectionPoint);
261 portMapList.add(createMappingObject(port, circuitPackName, logicalConnectionPoint,
264 } else if (port.getPortQual().getIntValue() == 1) {
266 LOG.info("Port is internal, skipping Logical Connection Point missing for "
267 + circuitPackName + " " + port.getPortName());
269 } else if (port.getLogicalConnectionPoint() == null) {
271 LOG.info("Value missing, Skipping Logical Connection Point missing for "
272 + circuitPackName + " " + port.getPortName());
280 } catch (InterruptedException | ExecutionException ex) {
281 LOG.warn("Read failed for " + circuitPackName,ex);
290 * This private method gets the list of circuit packs on a xponder. For each
291 * circuit pack on a Xponder, it does a get on circuit-pack subtree with
292 * circuit-pack-name as key in order to get the list of ports. It then
293 * iterates over the list of ports to get ports with port-qual as
294 * xpdr-network/xpdr-client. The line and client ports are saved as:
303 * Reference to device's databroker
305 * Info subtree read from the device
307 * Reference to the list containing the mapping to be pushed to
310 * @return true/false based on status of operation
313 private boolean createXpdrPortMapping(DataBroker deviceDb, Info deviceInfo, List<Mapping> portMapList) {
314 // Creating for Xponder Line and Client Ports
316 InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class);
317 ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
318 Optional<OrgOpenroadmDevice> deviceObject = rtx.read(LogicalDatastoreType.OPERATIONAL, deviceIID).get();
320 // Variable to keep track of number of line ports
322 // Variable to keep track of number of client ports
324 if (deviceObject.isPresent()) {
325 for (CircuitPacks cp : deviceObject.get().getCircuitPacks()) {
326 String circuitPackName = cp.getCircuitPackName();
327 for (Ports port : cp.getPorts()) {
328 if (port.getPortQual().getIntValue() == 3) {
329 // Port is xpdr-network
330 portMapList.add(createMappingObject(port, circuitPackName, "LINE" + line, deviceDb));
333 if (port.getPortQual().getIntValue() == 4) {
334 // port is xpdr-client
335 portMapList.add(createMappingObject(port, circuitPackName, "CLNT" + client, deviceDb));
341 LOG.info("Circuit Packs are not present for " + nodeId);
345 } catch (InterruptedException | ExecutionException ex) {
346 LOG.warn("Read failed for CircuitPacks of " + nodeId,ex);
353 * This private method builds the mapping object to be pushed in MD-SAL in
354 * order to save port mapping. In case of TTP ports, it also saves the
355 * OTS,OMS interfaces provisioned on the port.
358 * Reference to device's port subtree object.
359 * @param circuitPackName
360 * Name of cp where port exists.
361 * @param logicalConnectionPoint
362 * logical name of the port.
364 * Reference to device's databroker.
366 * @return true/false based on status of operation
369 private Mapping createMappingObject(Ports port, String circuitPackName, String logicalConnectionPoint,
370 DataBroker deviceDb) {
371 MappingBuilder mpBldr = new MappingBuilder();
372 mpBldr.setKey(new MappingKey(logicalConnectionPoint)).setLogicalConnectionPoint(logicalConnectionPoint)
373 .setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
375 // Get OMS and OTS interface provisioned on the TTP's
376 if (logicalConnectionPoint.contains("TTP") && port.getInterfaces() != null) {
377 for (Interfaces interfaces : port.getInterfaces()) {
378 Class<? extends InterfaceType> interfaceType = new OpenRoadmInterfaces(db, mps, nodeId,
379 logicalConnectionPoint).getInterface(interfaces.getInterfaceName()).getType();
380 // Check if interface type is OMS or OTS
381 if (interfaceType.equals(OpenROADMOpticalMultiplex.class)) {
382 String omsInterfaceName = interfaces.getInterfaceName();
383 mpBldr.setSupportingOms(omsInterfaceName);
385 if (interfaceType.equals(OpticalTransport.class)) {
386 String otsInterfaceName = interfaces.getInterfaceName();
387 mpBldr.setSupportingOts(otsInterfaceName);
391 return mpBldr.build();
395 * This method does a get operation on info subtree of the netconf device's
396 * configuration datastore and returns info object.It is required to get
397 * device attributes such as maxDegrees,maxSrgs and node-type.
400 * Reference to device's databroker
401 * @return Info object
404 private Info getDeviceInfo(DataBroker deviceDb) {
405 ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
406 InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
408 Optional<Info> ordmInfoObject = rtx.read(LogicalDatastoreType.OPERATIONAL, infoIID).get();
409 if (ordmInfoObject.isPresent()) {
410 return ordmInfoObject.get();
412 LOG.info("Info subtree is not present");
414 } catch (InterruptedException | ExecutionException ex) {
415 LOG.info("Read failed on info subtree ",ex);
422 * This method does a get operation on degree subtree of the netconf
423 * device's config datastore and returns a list of all connection port
424 * objects. It is required for doing a selective get on ports that
425 * correspond to logical connection points of interest.
428 * Reference to device's databroker
430 * Info subtree from the device
431 * @return List of connection ports object belonging to- degree subtree
433 private List<ConnectionPorts> getDegreePorts(DataBroker deviceDb, Info ordmInfo) {
435 List<ConnectionPorts> degreeConPorts = new ArrayList<>();
436 ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
439 // Get value for max degree from info subtree, required for iteration
440 // if not present assume to be 20 (temporary)
441 if (ordmInfo.getMaxDegrees() != null) {
442 maxDegree = ordmInfo.getMaxDegrees();
446 Integer degreeCounter = 1;
447 while (degreeCounter <= maxDegree) {
448 LOG.info("Getting Connection ports for Degree Number " + degreeCounter);
449 InstanceIdentifier<Degree> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
450 Degree.class, new DegreeKey(degreeCounter));
452 Optional<Degree> ordmDegreeObject = rtx.read(LogicalDatastoreType.CONFIGURATION, deviceIID).get();
454 if (ordmDegreeObject.isPresent()) {
455 degreeConPorts.addAll(new ArrayList<ConnectionPorts>(ordmDegreeObject.get().getConnectionPorts()));
458 LOG.info("Device has " + (degreeCounter - 1) + " degree");
461 } catch (InterruptedException | ExecutionException ex) {
462 LOG.info("Failed to read degree " + degreeCounter,ex);
468 return degreeConPorts;
472 * This method does a get operation on shared risk group subtree of the
473 * netconf device's config datastore and returns a list of all circuit packs
474 * objects that are part of srgs. It is required to do a selective get on
475 * all the circuit packs that contain add/drop ports of interest.
478 * Reference to device's databroker
480 * Info subtree from the device
481 * @return List of circuit packs object belonging to- shared risk group
485 private List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> getSrgCps(
486 DataBroker deviceDb, Info ordmInfo) {
488 List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps =
490 ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
492 // Get value for max Srg from info subtree, required for iteration
493 // if not present assume to be 20 (temporary)
494 if (ordmInfo.getMaxSrgs() != null) {
495 maxSrg = ordmInfo.getMaxSrgs();
500 Integer srgCounter = 1;
501 while (srgCounter <= maxSrg) {
502 LOG.info("Getting Circuitpacks for Srg Number " + srgCounter);
503 InstanceIdentifier<SharedRiskGroup> srgIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
504 SharedRiskGroup.class, new SharedRiskGroupKey(srgCounter));
506 Optional<SharedRiskGroup> ordmSrgObject = rtx.read(LogicalDatastoreType.CONFIGURATION, srgIID).get();
508 if (ordmSrgObject.isPresent()) {
511 new ArrayList<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
512 .CircuitPacks>(ordmSrgObject.get().getCircuitPacks()));
515 LOG.info("Device has " + (srgCounter - 1) + " Srg");
518 } catch (InterruptedException | ExecutionException ex) {
519 LOG.warn("Failed to read Srg " + srgCounter,ex);
529 * This method for ports the portMapping corresponding to the
530 * portmapping.yang file to the MD-SAL datastore.
533 * 1. Supporting circuit pack 2. Supporting port 3. Supporting OMS interface
537 * Info subtree from the device.
539 * Reference to the list containing the mapping to be pushed to
542 * @return Result true/false based on status of operation.
544 private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList, Integer nodeType) {
546 NodesBuilder nodesBldr = new NodesBuilder();
547 nodesBldr.setKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
548 nodesBldr.setNodeType(NodeTypes.forValue(nodeType));
549 nodesBldr.setMapping(portMapList);
550 List<Nodes> nodesList = new ArrayList<>();
551 nodesList.add(nodesBldr.build());
552 NetworkBuilder nwBldr = new NetworkBuilder();
553 nwBldr.setNodes(nodesList);
554 final WriteTransaction writeTransaction = db.newWriteOnlyTransaction();
555 InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
556 writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, nwBldr.build());
557 CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
562 } catch (TransactionCommitFailedException e) {
563 LOG.warn("Failed to post {} ", nwBldr.build(), e);
570 * This method for a given node's termination point returns the Mapping
571 * object based on portmapping.yang model stored in the MD-SAL data store
572 * which is created when the node is connected for the first time. The
573 * mapping object basically contains the following attributes of interest:
576 * 1. Supporting circuit pack
582 * 3. Supporting OMS interface (if port on ROADM) 4. Supporting OTS
583 * interface (if port on ROADM)
586 * Unique Identifier for the node of interest.
587 * @param logicalConnPoint
588 * Name of the logical point
590 * @return Result Mapping object if success otherwise null.
592 public static Mapping getMapping(String nodeId, String logicalConnPoint, DataBroker db) {
595 * Getting physical mapping corresponding to logical connection point
597 InstanceIdentifier<Mapping> portMapping = InstanceIdentifier.builder(Network.class).child(Nodes.class,
598 new NodesKey(nodeId)).child(Mapping.class, new MappingKey(logicalConnPoint)).build();
599 ReadOnlyTransaction readTx = db.newReadOnlyTransaction();
600 Optional<Mapping> mapObject;
602 mapObject = readTx.read(LogicalDatastoreType.CONFIGURATION, portMapping).get();
603 if (mapObject.isPresent()) {
604 LOG.info("Found mapping for the logical port " + mapObject.get().toString());
605 return mapObject.get();
607 LOG.info("Could not find mapping for logical connection point : " + logicalConnPoint + " for nodeId "
611 } catch (InterruptedException | ExecutionException ex) {
612 LOG.info("Unable to read mapping for logical connection point : " + logicalConnPoint + " for nodeId "
619 * This static method returns the DataBroker for a netconf node.
622 * Unique identifier for the mounted netconf- node
624 * Reference to mount service
625 * @return Databroker for the given device
627 public static DataBroker getDeviceDataBroker(String nodeId, MountPointService mps) {
628 MountPoint netconfNode = getDeviceMountPoint(nodeId, mps);
629 if (netconfNode != null) {
630 DataBroker netconfNodeDataBroker = netconfNode.getService(DataBroker.class).get();
631 return netconfNodeDataBroker;
633 LOG.info("Device Data broker not found for :" + nodeId);
638 public static MountPoint getDeviceMountPoint(String nodeId, MountPointService mps) {
639 InstanceIdentifier<Node> netconfNodeIID = InstanceIdentifier.builder(NetworkTopology.class).child(
640 Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName()))).child(Node.class,
641 new NodeKey(new NodeId(nodeId))).build();
643 // Get mount point for specified device
644 final Optional<MountPoint> netconfNodeOptional = mps.getMountPoint(netconfNodeIID);
645 if (netconfNodeOptional.isPresent()) {
646 MountPoint netconfNode = netconfNodeOptional.get();
649 LOG.info("Mount Point not found for :" + nodeId);