Update PortMapping & imports to v1.2.1 32/55932/6
authorDhruv Bhardwaj <db929a@att.com>
Mon, 24 Apr 2017 18:57:24 +0000 (21:57 +0300)
committerguillaume.lambert <guillaume.lambert@orange.com>
Thu, 27 Apr 2017 15:55:22 +0000 (17:55 +0200)
1. Updated code to Device model version 1.2.1.
2. Updated portmapping to store OTS interface required for spanloss
   measurement.
3. Updated portmapping to handle uni-directional PP ports by appending
   TX/RX/TXRX based on direction of th port.
4. Updated portmapping to create mapping for xponder line and client
   ports.
Signed-off-by: Dhruv Bhardwaj <db929a@att.com>
Change-Id: Icb440866648d4d1c50f12d9684c1321003f96da7

api/src/main/yang/portmapping.yang
ordmodels/pom.xml
ordmodels/src/main/yang/ietf-netconf-monitoring-extension.yang [deleted file]
ordmodels/src/main/yang/org-openroadm-device.yang
renderer/src/main/java/org/opendaylight/transportpce/renderer/RendererNotificationsImpl.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/listeners/DeviceListener.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/mapping/PortMapping.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/DeviceRenderer.java
renderer/src/main/java/org/opendaylight/transportpce/renderer/provisiondevice/OpenRoadmInterfaces.java

index 5a0a36545c2a90b2f5e824664373abb7882fc5cb..d2fba6e2eb54f600b8eaa1341e81b241331b2407 100644 (file)
@@ -37,6 +37,11 @@ module portmapping {
           description
           "OMS interface provisioned on the port";
         }
+        leaf supporting-ots{
+          type string;
+          description
+          "OTS interface provisioned on the port";
+        }
       }
     }
   }
index a63a342780aff72d1185c76b8c6e92cce048abbf..6946dfc0f94919768d879c223f11aefd0fa7270f 100644 (file)
@@ -29,7 +29,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>iana-afn-safi</artifactId>
-      <version>2013.07.04.9.3-SNAPSHOT</version>
+      <version>2013.07.04.9.4-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
@@ -38,7 +38,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
       <artifactId>iana-if-type-2014-05-08</artifactId>
-      <version>2014.05.08.9.3-SNAPSHOT</version>
+      <version>2014.05.08.9.4-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>org.opendaylight.mdsal.model</groupId>
@@ -47,7 +47,7 @@ and is available at http://www.eclipse.org/legal/epl-v10.html
     <dependency>
     <groupId>org.opendaylight.mdsal.model</groupId>
     <artifactId>ietf-interfaces</artifactId>
-    <version>2014.05.08.9.3-SNAPSHOT</version>
+      <version>2014.05.08.9.4-SNAPSHOT</version>
     </dependency>
     <dependency>
     <groupId>org.opendaylight.mdsal.model</groupId>
diff --git a/ordmodels/src/main/yang/ietf-netconf-monitoring-extension.yang b/ordmodels/src/main/yang/ietf-netconf-monitoring-extension.yang
deleted file mode 100644 (file)
index e8f2ec3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-module ietf-netconf-monitoring-extension {
-
-    yang-version 1;
-
-    namespace
-      "urn:ietf:params:xml:ns:yang:ietf-netconf-monitoring-extension";
-
-    prefix ncme;
-
-    import ietf-netconf-monitoring {
-      prefix ncm;
-    }
-
-    revision "2013-12-10" {
-      description "Initial revision.";
-
-    }
-
-    identity netconf-tcp {
-      base ncm:transport;
-      description
-        "NETCONF over TCP.";
-    }
-
-    augment "/ncm:netconf-state/ncm:sessions/ncm:session" {
-      leaf session-identifier {
-        type string;
-      }
-    }
-
-}
\ No newline at end of file
index d633b1572a82ff244f806b65b486e64f4a7cd50e..03d96597d145a84aa47616728ed0e5f865d2c711 100644 (file)
@@ -85,6 +85,11 @@ module org-openroadm-device {
      Section 4.e of the Trust Legal Provisions and are provided without warranty as 
      described in the Simplified BSD License.";
 
+  revision 2017-02-06 {
+    description
+      "Version 1.2.1 - removed pattern for current-datetime in info tree and rpc";
+  }
+
   revision 2016-10-14 {
     description
       "Version 1.2";
@@ -182,9 +187,7 @@ module org-openroadm-device {
       "Set the info/current-datetime leaf to the specified value.";
     input {     
      leaf current-datetime {
-        type ietf-yang-types:date-and-time {
-          pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}';
-        }
+        type ietf-yang-types:date-and-time; 
         mandatory true;
         description
           "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS";
@@ -288,9 +291,7 @@ module org-openroadm-device {
         "Template information used in the deployment.";
     }
     leaf current-datetime {
-      type ietf-yang-types:date-and-time {
-        pattern '\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?';
-      }                                                     
+      type ietf-yang-types:date-and-time; 
       config false;
       description
         "The current system date and time in UTC. Format: YYYY-MM-DDTHH:MM:SS.mm+ ";
@@ -1209,4 +1210,4 @@ module org-openroadm-device {
       }
     } // list edit
   } // notification change-notification
-}
+}
\ No newline at end of file
index 90b12a93e6b6a3f1c85b3ca839fc45ec8dde737a..451c1a64a79088f9a8b602fa1e5f533ac0990209 100644 (file)
@@ -40,7 +40,7 @@ import org.opendaylight.transportpce.renderer.mapping.PortMapping;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev161014.AlarmNotification;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.alarm.rev161014.OrgOpenroadmAlarmListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.de.operations.rev161014.OrgOpenroadmDeOperationsListener;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.OrgOpenroadmDeviceListener;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OrgOpenroadmDeviceListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.lldp.rev161014.OrgOpenroadmLldpListener;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.tca.rev161014.OrgOpenroadmTcaListener;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionInputBuilder;
@@ -60,6 +60,7 @@ import org.opendaylight.yangtools.concepts.ListenerRegistration;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.binding.KeyedInstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -229,4 +230,4 @@ public class RendererNotificationsImpl implements DataTreeChangeListener<Node> {
             }
         }
     }
-}
\ No newline at end of file
+}
index 4b0f45c051330b885c5fc093b8f6dd86f9db3a4c..2f57b31083485271d8f280383f2654d9f155205d 100644 (file)
@@ -8,9 +8,9 @@
 
 package org.opendaylight.transportpce.renderer.listeners;
 
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.ChangeNotification;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.OrgOpenroadmDeviceListener;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.OtdrScanResult;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.ChangeNotification;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OrgOpenroadmDeviceListener;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.OtdrScanResult;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
index c8fc2a1acbe3db4531f28054c7bf237d99639469..7945cf4edd2365f42a54d0c7b7c12c46b1e5dc77 100644 (file)
@@ -22,17 +22,23 @@ import org.opendaylight.controller.md.sal.binding.api.ReadOnlyTransaction;
 import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.pack.Ports;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.pack.PortsKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.packs.CircuitPacks;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.packs.CircuitPacksKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.degree.ConnectionPorts;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.Degree;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.DegreeKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.Info;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.Ports;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.PortsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.degree.ConnectionPorts;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Degree;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.DegreeKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.Info;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroup;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.SharedRiskGroupKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.InterfaceType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpenROADMOpticalMultiplex;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalTransport;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.network.topology.topology.topology.types.TopologyNetconf;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.Network;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.NetworkBuilder;
@@ -58,7 +64,6 @@ public class PortMapping {
     private static final Logger LOG = LoggerFactory.getLogger(PortMapping.class);
     private final DataBroker db;
     private final MountPointService mps;
-
     private final String nodeId;
 
     public PortMapping(DataBroker db, MountPointService mps, String nodeId) {
@@ -69,163 +74,364 @@ public class PortMapping {
     }
 
     /**
-    * This method creates logical to physical port mapping
-    * for a given device.
-    * Instead of parsing all the circuit packs/ports in the device
-    * this methods does a selective read operation on degree/srg
-    * subtree to get circuit packs/ports that map to :
-    *   DEGn-TTP-TX
-    *   DEGn-TTP-RX
-    *   DEGn-TTP-TXRX
-    *   SRGn-PPp
-    * This methods skips the logical ports that are internal.
-    * if operation is successful the mapping gets stored in
-    * datastore corresponding to portmapping.yang data model.
-    *
-    * @return true/false based on status of operation
-    */
+     * This method creates logical to physical port mapping for a given device.
+     * Instead of parsing all the circuit packs/ports in the device this methods
+     * does a selective read operation on degree/srg subtree to get circuit
+     * packs/ports that map to :
+     *
+     * <p>
+     * 1. DEGn-TTP-TX, DEGn-TTP-RX, DEGn-TTP-TXRX
+     *
+     * <p>
+     * 2. SRGn-PPp-TX, SRGn-PPp-RX, SRGn-PPp-TXRX
+     *
+     * <p>
+     * 3. LINEn
+     *
+     * <p>
+     * 4. CLNTn.
+     *
+     * <p>
+     * If the port is Mw it also store the OMS, OTS interface provisioned on the
+     * port. It skips the logical ports that are internal. If operation is
+     * successful the mapping gets stored in datastore corresponding to
+     * portmapping.yang data model.
+     *
+     * @return true/false based on status of operation
+     */
     public boolean createMappingData() {
 
         LOG.info(" Create Mapping Data for node " + nodeId);
-
         DataBroker deviceDb = getDeviceDataBroker(nodeId, mps);
         Info deviceInfo = getDeviceInfo(deviceDb);
-
-        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
-
-        NetworkBuilder nwBldr = new NetworkBuilder();
         List<Mapping> portMapList = new ArrayList<>();
-        List<Nodes> nodesList = new ArrayList<>();
-
-        if (deviceDb != null && deviceInfo != null) {
-
-            // Creating mapping data for degree TTP's
-            List<ConnectionPorts> degreeConPorts = getDegreePorts(deviceDb, deviceInfo);
-
-            //Getting circuit-pack-name/port-name corresponding to TTP's
-            for (ConnectionPorts cp : degreeConPorts) {
 
-                InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
-                    CircuitPacks.class, new CircuitPacksKey(cp.getCircuitPackName())).child(Ports.class, new PortsKey(cp
-                        .getPortName().toString()));
-                try {
-                    LOG.info("Fetching logical Connection Point value for port " + cp.getPortName().toString()
-                        + " at circuit pack " + cp.getCircuitPackName());
-                    ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
-                    Optional<Ports> portObject = rtx.read(LogicalDatastoreType.OPERATIONAL, portIID).get();
-
-                    if (portObject.isPresent()) {
-                        Ports port = portObject.get();
-                        if (port.getLogicalConnectionPoint() != null) {
+        if (deviceDb != null) {
+            if (deviceInfo != null) {
+                Integer nodeType = deviceInfo.getNodeType().getIntValue();
+                // Create Mapping for Roadm Node
+                if (nodeType == 1) {
+                    // Get TTP port mapping
+                    if (!createTtpPortMapping(deviceDb, deviceInfo, portMapList)) {
+                        // return false if mapping creation for TTP's failed
+                        LOG.info("Unable to create mapping for TTP's");
+                        return false;
+                    }
 
-                            LOG.info("Logical Connection Point for " + cp.getCircuitPackName() + " " + port
-                                .getPortName() + " is " + port.getLogicalConnectionPoint());
-                            MappingBuilder mpBldr = new MappingBuilder();
-                            mpBldr.setKey(new MappingKey(port.getLogicalConnectionPoint())).setLogicalConnectionPoint(
-                                port.getLogicalConnectionPoint()).setSupportingCircuitPackName(cp.getCircuitPackName())
-                                .setSupportingPort(port.getPortName());
-                            portMapList.add(mpBldr.build());
+                    // Get PP port mapping
+                    if (!createPpPortMapping(deviceDb, deviceInfo, portMapList)) {
+                        // return false if mapping creation for PP's failed
+                        LOG.info("Unable tp create mapping for PP's");
+                        return false;
+                    }
+                }
+                // Create Mapping for Xponder Node
+                if (nodeType == 2) {
+                    if (!createXpdrPortMapping(deviceDb, deviceInfo, portMapList)) {
+                        LOG.info("Unable to create mapping for Xponder");
+                        return false;
+                    }
+                }
+            } else {
+                LOG.info(" Device info subtree is absent for " + nodeId);
+                return false;
+            }
 
-                        } else {
+        } else {
+            LOG.info(" Unable to get Data broker for node " + nodeId);
+            return false;
+        }
+        return postPortMapping(deviceInfo, portMapList);
+    }
 
-                            LOG.warn("Logical Connection Point value missing for " + cp.getCircuitPackName() + " "
-                                + port.getPortName());
-                        }
+    /**
+     * This private method gets the list of external ports on a degree. For each
+     * port in the degree, it does a get on port subtree with
+     * circuit-pack-name/port-name as key in order to get the logical connection
+     * point name corresponding to it.
+     *
+     * @param deviceDb
+     *            Reference to device's databroker
+     * @param deviceInfo
+     *            Info subtree read from the device
+     * @param portMapList
+     *            Reference to the list containing the mapping to be pushed to
+     *            MD-SAL
+     *
+     * @return true/false based on status of operation
+     */
+    private boolean createTtpPortMapping(DataBroker deviceDb, Info deviceInfo, List<Mapping> portMapList) {
+        // Creating mapping data for degree TTP's
+        List<ConnectionPorts> degreeConPorts = getDegreePorts(deviceDb, deviceInfo);
+
+        // Getting circuit-pack-name/port-name corresponding to TTP's
+        for (ConnectionPorts cp : degreeConPorts) {
+            String circuitPackName = cp.getCircuitPackName();
+            String portName = cp.getPortName().toString();
+            InstanceIdentifier<Ports> portIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+                CircuitPacks.class, new CircuitPacksKey(circuitPackName)).child(Ports.class, new PortsKey(portName));
+            try {
+                LOG.info("Fetching logical Connection Point value for port " + portName + " at circuit pack "
+                    + circuitPackName);
+                ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
+                Optional<Ports> portObject = rtx.read(LogicalDatastoreType.OPERATIONAL, portIID).get();
+                if (portObject.isPresent()) {
+                    Ports port = portObject.get();
+                    if (port.getLogicalConnectionPoint() != null) {
+
+                        LOG.info("Logical Connection Point for " + circuitPackName + " " + portName + " is " + port
+                            .getLogicalConnectionPoint());
+                        portMapList.add(createMappingObject(port, circuitPackName, port.getLogicalConnectionPoint(),
+                            deviceDb));
+                    } else {
+
+                        LOG.warn("Logical Connection Point value missing for " + circuitPackName + " " + port
+                            .getPortName());
                     }
-                } catch (InterruptedException | ExecutionException ex) {
-                    LOG.warn("Read failed for Logical Connection Point value missing for " + cp.getCircuitPackName()
-                        + " " + cp.getPortName());
                 }
+            } catch (InterruptedException | ExecutionException ex) {
+                LOG.warn("Read failed for Logical Connection Point value missing for " + circuitPackName + " "
+                    + portName);
+                return false;
             }
-            // Creating mapping data for degree PP's
-            List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.srg.CircuitPacks> srgCps = getSrgCps(
-                deviceDb, deviceInfo);
-
-            for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.srg.CircuitPacks cps : srgCps) {
-                InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
-                    CircuitPacks.class, new CircuitPacksKey(cps.getCircuitPackName()));
-                try {
+        }
+        return true;
+    }
 
-                    ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
-                    Optional<CircuitPacks> circuitPackObject = rtx.read(LogicalDatastoreType.OPERATIONAL, cpIID).get();
+    /**
+     * This private method gets the list of circuit packs on an Srg. For each
+     * circuit pack on an Srg, it does a get on circuit-pack subtree with
+     * circuit-pack-name as key in order to get the list of ports. It then
+     * iterates over the list of ports to get ports with port-qual as
+     * roadm-external. It appends a TX,RX,TXRX to the logical connection point
+     * name based on the direction of the port.
+     *
+     * @param deviceDb
+     *            Reference to device's databroker
+     * @param deviceInfo
+     *            Info subtree read from the device
+     * @param portMapList
+     *            Reference to the list containing the mapping to be pushed to
+     *            MD-SAL
+     *
+     * @return true/false based on status of operation
+     */
 
-                    if (circuitPackObject.isPresent()) {
-                        CircuitPacks circuitPack = circuitPackObject.get();
-                        if (!circuitPack.getPorts().isEmpty()) {
-                            for (Ports port : circuitPack.getPorts()) {
+    private boolean createPpPortMapping(DataBroker deviceDb, Info deviceInfo, List<Mapping> portMapList) {
+        // Creating mapping data for degree PP's
+        List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps = getSrgCps(
+            deviceDb, deviceInfo);
 
-                                if (port.getLogicalConnectionPoint() != null && port.getPortQual().getIntValue() == 2) {
+        for (org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks cps : srgCps) {
+            String circuitPackName = cps.getCircuitPackName();
+            try {
+                InstanceIdentifier<CircuitPacks> cpIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+                    CircuitPacks.class, new CircuitPacksKey(circuitPackName));
+                ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
+                Optional<CircuitPacks> circuitPackObject = rtx.read(LogicalDatastoreType.OPERATIONAL, cpIID).get();
+
+                if (circuitPackObject.isPresent()) {
+                    CircuitPacks cp = circuitPackObject.get();
+                    if (!cp.getPorts().isEmpty()) {
+                        for (Ports port : cp.getPorts()) {
+
+                            if (port.getLogicalConnectionPoint() != null && port.getPortQual().getIntValue() == 2) {
+                                String logicalConnectionPoint = null;
+                                if (port.getPortDirection().getIntValue() == 1) {
+                                    // Port direction is transmit
+                                    logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TX";
+                                }
+                                if (port.getPortDirection().getIntValue() == 2) {
+                                    // Port direction is receive
+                                    logicalConnectionPoint = port.getLogicalConnectionPoint() + "-RX";
+                                }
+                                if (port.getPortDirection().getIntValue() == 3) {
+                                    // port is bi-directional
+                                    logicalConnectionPoint = port.getLogicalConnectionPoint() + "-TXRX";
+                                }
 
-                                    LOG.info("Logical Connection Point for " + circuitPack.getCircuitPackName() + " "
-                                        + port.getPortName() + " is " + port.getLogicalConnectionPoint());
-                                    MappingBuilder mpBldr = new MappingBuilder();
-                                    mpBldr.setKey(new MappingKey(port.getLogicalConnectionPoint()))
-                                        .setLogicalConnectionPoint(port.getLogicalConnectionPoint())
-                                        .setSupportingCircuitPackName(circuitPack.getCircuitPackName())
-                                        .setSupportingPort(port.getPortName());
-                                    portMapList.add(mpBldr.build());
+                                LOG.info("Logical Connection Point for " + circuitPackName + " " + port.getPortName()
+                                    + " is " + logicalConnectionPoint);
 
-                                } else if (port.getPortQual().getIntValue() == 1) {
+                                portMapList.add(createMappingObject(port, circuitPackName, logicalConnectionPoint,
+                                    deviceDb));
 
-                                    LOG.info("Port is internal, skipping Logical Connection Point missing for "
-                                        + circuitPack.getCircuitPackName() + " " + port.getPortName());
+                            } else if (port.getPortQual().getIntValue() == 1) {
 
-                                } else if (port.getLogicalConnectionPoint() == null) {
+                                LOG.info("Port is internal, skipping Logical Connection Point missing for "
+                                    + circuitPackName + " " + port.getPortName());
 
-                                    LOG.info("Value missing, Skipping Logical Connection Point missing for "
-                                        + circuitPack.getCircuitPackName() + " " + port.getPortName());
-                                }
+                            } else if (port.getLogicalConnectionPoint() == null) {
 
+                                LOG.info("Value missing, Skipping Logical Connection Point missing for "
+                                    + circuitPackName + " " + port.getPortName());
                             }
 
                         }
 
                     }
-                } catch (InterruptedException | ExecutionException ex) {
-                    LOG.warn("Read failed for " + cps.getCircuitPackName());
-                }
 
+                }
+            } catch (InterruptedException | ExecutionException ex) {
+                LOG.warn("Read failed for " + circuitPackName);
+                return false;
             }
+        }
 
-            NodesBuilder nodesBldr = new NodesBuilder();
-            nodesBldr.setKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
-            nodesBldr.setMapping(portMapList);
-            nodesList.add(nodesBldr.build());
-            nwBldr.setNodes(nodesList);
-            final WriteTransaction writeTransaction = db.newWriteOnlyTransaction();
-            writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, nwBldr.build());
-            CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
-            try {
-                submit.checkedGet();
-                return true;
+        return true;
+    }
 
-            } catch (TransactionCommitFailedException e) {
-                LOG.warn("Failed to post {} ", nwBldr.build(), e);
-                return false;
+    /**
+     * This private method gets the list of circuit packs on a xponder. For each
+     * circuit pack on a Xponder, it does a get on circuit-pack subtree with
+     * circuit-pack-name as key in order to get the list of ports. It then
+     * iterates over the list of ports to get ports with port-qual as
+     * xpdr-network/xpdr-client. The line and client ports are saved as:
+     *
+     * <p>
+     * 1. LINEn
+     *
+     * <p>
+     * 2. CLNTn
+     *
+     * @param deviceDb
+     *            Reference to device's databroker
+     * @param deviceInfo
+     *            Info subtree read from the device
+     * @param portMapList
+     *            Reference to the list containing the mapping to be pushed to
+     *            MD-SAL
+     *
+     * @return true/false based on status of operation
+     */
 
+    private boolean createXpdrPortMapping(DataBroker deviceDb, Info deviceInfo, List<Mapping> portMapList) {
+        // Creating for Xponder Line and Client Ports
+        try {
+            InstanceIdentifier<OrgOpenroadmDevice> deviceIID = InstanceIdentifier.create(OrgOpenroadmDevice.class);
+            ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
+            Optional<OrgOpenroadmDevice> deviceObject = rtx.read(LogicalDatastoreType.OPERATIONAL, deviceIID).get();
+
+            // Variable to keep track of number of line ports
+            int line = 1;
+            // Variable to keep track of number of client ports
+            int client = 1;
+            if (deviceObject.isPresent()) {
+                for (CircuitPacks cp : deviceObject.get().getCircuitPacks()) {
+                    String circuitPackName = cp.getCircuitPackName();
+                    for (Ports port : cp.getPorts()) {
+                        if (port.getPortQual().getIntValue() == 3) {
+                            // Port is xpdr-network
+                            portMapList.add(createMappingObject(port, circuitPackName, "LINE" + line, deviceDb));
+                            line++;
+                        }
+                        if (port.getPortQual().getIntValue() == 4) {
+                            // port is xpdr-client
+                            portMapList.add(createMappingObject(port, circuitPackName, "CLNT" + client, deviceDb));
+                            client++;
+                        }
+                    }
+                }
+            } else {
+                LOG.info("Circuit Packs are not present for " + nodeId);
+                return false;
             }
-        } else {
-            LOG.info(" Unable to get Data broker for node " + nodeId);
+
+        } catch (InterruptedException | ExecutionException ex) {
+            LOG.warn("Read failed for CircuitPacks of " + nodeId);
             return false;
         }
+        return true;
+    }
+
+    /**
+     * This private method builds the mapping object to be pushed in MD-SAL in
+     * order to save port mapping. In case of TTP ports, it also saves the
+     * OTS,OMS interfaces provisioned on the port.
+     *
+     * @param port
+     *            Reference to device's port subtree object.
+     * @param circuitPackName
+     *            Name of cp where port exists.
+     * @param logicalConnectionPoint
+     *            logical name of the port.
+     * @param deviceDb
+     *            Reference to device's databroker.
+     *
+     * @return true/false based on status of operation
+     */
 
+    private Mapping createMappingObject(Ports port, String circuitPackName, String logicalConnectionPoint,
+        DataBroker deviceDb) {
+        MappingBuilder mpBldr = new MappingBuilder();
+        mpBldr.setKey(new MappingKey(logicalConnectionPoint)).setLogicalConnectionPoint(logicalConnectionPoint)
+            .setSupportingCircuitPackName(circuitPackName).setSupportingPort(port.getPortName());
+
+        // Get OMS and OTS interface provisioned on the TTP's
+        if (logicalConnectionPoint.contains("TTP") && port.getInterfaces() != null) {
+            for (Interfaces interfaces : port.getInterfaces()) {
+                Class<? extends InterfaceType> interfaceType = getInterfaceType(deviceDb, interfaces
+                    .getInterfaceName());
+                // Check if interface type is OMS or OTS
+                if (interfaceType.equals(OpenROADMOpticalMultiplex.class)) {
+                    String omsInterfaceName = interfaces.getInterfaceName();
+                    mpBldr.setSupportingOms(omsInterfaceName);
+                }
+                if (interfaceType.equals(OpticalTransport.class)) {
+                    String otsInterfaceName = interfaces.getInterfaceName();
+                    mpBldr.setSupportingOts(otsInterfaceName);
+                }
+            }
+        }
+        return mpBldr.build();
     }
 
     /**
-     * This method does a get operation on info subtree
-     * of the netconf device's config datastore and returns
-     * info object.It is required to get device attributes such
-     * as maxDegrees,maxSrgs.
+     * This private does a get on the interface subtree of the device with the
+     * interface name as the key and return the class corresponding to the
+     * interface type.
      *
-     * @param deviceDb Reference to device's databroker
+     * @param interfaceName
+     *            Name of the interface
+     * @param deviceDb
+     *            Reference to device's databroker.
+     *
+     * @return true/false based on status of operation
+     */
+
+    private Class<? extends InterfaceType> getInterfaceType(DataBroker deviceDb, String interfaceName) {
+        ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
+        InstanceIdentifier<Interface> interfacesIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(
+            Interface.class, new InterfaceKey(interfaceName));
+        try {
+            Optional<Interface> interfaceObject = rtx.read(LogicalDatastoreType.OPERATIONAL, interfacesIID).get();
+            if (interfaceObject.isPresent()) {
+                return interfaceObject.get().getType();
+            } else {
+                LOG.info("Interface subtree is not present for " + interfaceName);
+            }
+        } catch (InterruptedException | ExecutionException ex) {
+            LOG.info("Read failed on interface subtree for");
+            return null;
+        }
+        return null;
+    }
+
+    /**
+     * This method does a get operation on info subtree of the netconf device's
+     * configuration datastore and returns info object.It is required to get
+     * device attributes such as maxDegrees,maxSrgs and node-type.
+     *
+     * @param deviceDb
+     *            Reference to device's databroker
      * @return Info object
      *
      */
-    public Info getDeviceInfo(DataBroker deviceDb) {
+    private Info getDeviceInfo(DataBroker deviceDb) {
         ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
         InstanceIdentifier<Info> infoIID = InstanceIdentifier.create(OrgOpenroadmDevice.class).child(Info.class);
         try {
-            Optional<Info> ordmInfoObject = rtx.read(LogicalDatastoreType.CONFIGURATION, infoIID).get();
+            Optional<Info> ordmInfoObject = rtx.read(LogicalDatastoreType.OPERATIONAL, infoIID).get();
             if (ordmInfoObject.isPresent()) {
                 return ordmInfoObject.get();
             } else {
@@ -239,25 +445,25 @@ public class PortMapping {
     }
 
     /**
-     * This method does a get operation on degree subtree
-     * of the netconf device's config datastore and returns a list
-     * of all connection port objects.
-     * It is required for doing a selective get on ports that
+     * This method does a get operation on degree subtree of the netconf
+     * device's config datastore and returns a list of all connection port
+     * objects. It is required for doing a selective get on ports that
      * correspond to logical connection points of interest.
      *
-     * @param deviceDb Reference to device's databroker
-     * @param ordmInfo Info subtree from the device
-     * @return List of connection ports object belonging to-
-     *         degree subtree
+     * @param deviceDb
+     *            Reference to device's databroker
+     * @param ordmInfo
+     *            Info subtree from the device
+     * @return List of connection ports object belonging to- degree subtree
      */
-    public List<ConnectionPorts> getDegreePorts(DataBroker deviceDb, Info ordmInfo) {
+    private List<ConnectionPorts> getDegreePorts(DataBroker deviceDb, Info ordmInfo) {
 
         List<ConnectionPorts> degreeConPorts = new ArrayList<>();
         ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
         Integer maxDegree;
 
-        //Get value for max degree from info subtree, required for iteration
-        //if not present assume to be 20 (temporary)
+        // Get value for max degree from info subtree, required for iteration
+        // if not present assume to be 20 (temporary)
         if (ordmInfo.getMaxDegrees() != null) {
             maxDegree = ordmInfo.getMaxDegrees();
         } else {
@@ -289,27 +495,28 @@ public class PortMapping {
     }
 
     /**
-     * This method does a get operation on shared risk group subtree
-     * of the netconf device's config datastore and returns a list
-     * of all circuit packs objects that are part of srgs.
-     * It is required to do a selective get on all the circuit packs
-     * that contain add/drop ports of interest.
+     * This method does a get operation on shared risk group subtree of the
+     * netconf device's config datastore and returns a list of all circuit packs
+     * objects that are part of srgs. It is required to do a selective get on
+     * all the circuit packs that contain add/drop ports of interest.
      *
-     * @param deviceDb Reference to device's databroker
-     * @param ordmInfo Info subtree from the device
-     * @return List of circuit packs object belonging to-
-     *         shared risk group subtree
+     * @param deviceDb
+     *            Reference to device's databroker
+     * @param ordmInfo
+     *            Info subtree from the device
+     * @return List of circuit packs object belonging to- shared risk group
+     *         subtree
      */
 
-    public List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.srg.CircuitPacks> getSrgCps(
+    private List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> getSrgCps(
         DataBroker deviceDb, Info ordmInfo) {
 
-        List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.srg.CircuitPacks> srgCps =
+        List<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg.CircuitPacks> srgCps =
             new ArrayList<>();
         ReadOnlyTransaction rtx = deviceDb.newReadOnlyTransaction();
         Integer maxSrg;
-        //Get value for max Srg from info subtree, required for iteration
-        //if not present assume to be 20 (temporary)
+        // Get value for max Srg from info subtree, required for iteration
+        // if not present assume to be 20 (temporary)
         if (ordmInfo.getMaxSrgs() != null) {
             maxSrg = ordmInfo.getMaxSrgs();
         } else {
@@ -327,8 +534,8 @@ public class PortMapping {
                 if (ordmSrgObject.isPresent()) {
 
                     srgCps.addAll(
-                        new ArrayList<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.srg
-                            .CircuitPacks>(ordmSrgObject.get().getCircuitPacks()));
+                        new ArrayList<org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.srg
+                        .CircuitPacks>(ordmSrgObject.get().getCircuitPacks()));
 
                 } else {
                     LOG.info("Device has " + (srgCounter - 1) + " Srg");
@@ -345,15 +552,103 @@ public class PortMapping {
     }
 
     /**
-     * This static method returns the DataBroker for a netconf
-     * node.
+     * This method for ports the portMapping corresponding to the
+     * portmapping.yang file to the MD-SAL datastore.
      *
-     * @param nodeId Unique identifier for the mounted netconf-
-     *               node
-     * @param mps Reference to mount service
-     * @return Databroker for the given device
+     * <p>
+     * 1. Supporting circuit pack 2. Supporting port 3. Supporting OMS interface
+     * (if port on ROADM)
+     *
+     * @param deviceInfo
+     *            Info subtree from the device.
+     * @param portMapList
+     *            Reference to the list containing the mapping to be pushed to
+     *            MD-SAL.
+     *
+     * @return Result true/false based on status of operation.
      */
+    private boolean postPortMapping(Info deviceInfo, List<Mapping> portMapList) {
+
+        List<Nodes> nodesList = new ArrayList<>();
+        NodesBuilder nodesBldr = new NodesBuilder();
+        nodesBldr.setKey(new NodesKey(deviceInfo.getNodeId())).setNodeId(deviceInfo.getNodeId());
+        nodesBldr.setMapping(portMapList);
+        nodesList.add(nodesBldr.build());
+        NetworkBuilder nwBldr = new NetworkBuilder();
+        nwBldr.setNodes(nodesList);
+        final WriteTransaction writeTransaction = db.newWriteOnlyTransaction();
+        InstanceIdentifier<Network> nodesIID = InstanceIdentifier.builder(Network.class).build();
+        writeTransaction.merge(LogicalDatastoreType.CONFIGURATION, nodesIID, nwBldr.build());
+        CheckedFuture<Void, TransactionCommitFailedException> submit = writeTransaction.submit();
+        try {
+            submit.checkedGet();
+            return true;
 
+        } catch (TransactionCommitFailedException e) {
+            LOG.warn("Failed to post {} ", nwBldr.build(), e);
+            return false;
+
+        }
+    }
+
+    /**
+     * This method for a given node's termination point returns the Mapping
+     * object based on portmapping.yang model stored in the MD-SAL data store
+     * which is created when the node is connected for the first time. The
+     * mapping object basically contains the following attributes of interest:
+     *
+     * <p>
+     * 1. Supporting circuit pack
+     *
+     * <p>
+     * 2. Supporting port
+     *
+     * <p>
+     * 3. Supporting OMS interface (if port on ROADM) 4. Supporting OTS
+     * interface (if port on ROADM)
+     *
+     * @param nodeId
+     *            Unique Identifier for the node of interest.
+     * @param logicalConnPoint
+     *            Name of the logical point
+     *
+     * @return Result Mapping object if success otherwise null.
+     */
+    public static Mapping getMapping(String nodeId, String logicalConnPoint, DataBroker db) {
+
+        /*
+         * Getting physical mapping corresponding to logical connection point
+         */
+        InstanceIdentifier<Mapping> portMapping = InstanceIdentifier.builder(Network.class).child(Nodes.class,
+            new NodesKey(nodeId)).child(Mapping.class, new MappingKey(logicalConnPoint)).build();
+        ReadOnlyTransaction readTx = db.newReadOnlyTransaction();
+        Optional<Mapping> mapObject;
+        try {
+            mapObject = readTx.read(LogicalDatastoreType.CONFIGURATION, portMapping).get();
+            if (mapObject.isPresent()) {
+                LOG.info("Found mapping for the logical port " + mapObject.get().toString());
+                return mapObject.get();
+            } else {
+                LOG.info("Could not find mapping for logical connection point : " + logicalConnPoint + " for nodeId "
+                    + nodeId);
+                return null;
+            }
+        } catch (InterruptedException | ExecutionException ex) {
+            LOG.info("Unable to read mapping for logical connection point : " + logicalConnPoint + " for nodeId "
+                + nodeId);
+        }
+        return null;
+    }
+
+    /**
+     * This static method returns the DataBroker for a netconf node.
+     *
+     * @param nodeId
+     *            Unique identifier for the mounted netconf- node
+     * @param mps
+     *            Reference to mount service
+     * @return Databroker for the given device
+     */
     public static DataBroker getDeviceDataBroker(String nodeId, MountPointService mps) {
         InstanceIdentifier<Node> netconfNodeIID = InstanceIdentifier.builder(NetworkTopology.class).child(
             Topology.class, new TopologyKey(new TopologyId(TopologyNetconf.QNAME.getLocalName()))).child(Node.class,
index e5fb17932148dd9b7d09bdbb225891a7f2ec128c..6df6ddb27c6d140c1fcbcc1f4fe6814f56a44c4c 100644 (file)
@@ -23,14 +23,14 @@ import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.transportpce.renderer.mapping.PortMapping;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.types.rev161014.OpticalControlMode;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.connection.DestinationBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.connection.SourceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.interfaces.grp.InterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.DestinationBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.connection.SourceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnections;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.org.openroadm.device.RoadmConnectionsKey;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.RendererService;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathInput;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer.rev170228.ServicePathOutput;
@@ -39,6 +39,7 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.renderer
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
 import org.opendaylight.yangtools.yang.common.RpcResult;
 import org.opendaylight.yangtools.yang.common.RpcResultBuilder;
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -257,4 +258,4 @@ public class DeviceRenderer implements RendererService {
         return delServBldr.setResult("Request processed");
     }
 
-}
\ No newline at end of file
+}
index 39e64da574c77d6288676c35460eec6f2c649bac..0a2a612fa94301c84b8fdca87b747ca13acffcce 100644 (file)
@@ -21,15 +21,15 @@ import org.opendaylight.controller.md.sal.binding.api.WriteTransaction;
 import org.opendaylight.controller.md.sal.common.api.data.LogicalDatastoreType;
 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
 import org.opendaylight.transportpce.renderer.mapping.PortMapping;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.pack.Ports;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.pack.PortsKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.packs.CircuitPacks;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.circuit.packs.CircuitPacksKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.interfaces.grp.Interface;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.interfaces.grp.InterfaceBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.interfaces.grp.InterfaceKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.org.openroadm.device.container.OrgOpenroadmDevice;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev161014.port.Interfaces;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.Ports;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.pack.PortsKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacks;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.circuit.packs.CircuitPacksKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.Interface;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.interfaces.grp.InterfaceKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.org.openroadm.device.container.OrgOpenroadmDevice;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.device.rev170206.port.Interfaces;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.interfaces.rev161014.OpticalChannel;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.Interface1Builder;
@@ -41,6 +41,8 @@ import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapp
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingBuilder;
 import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.portmapping.rev170228.network.nodes.MappingKey;
 import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+
+
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -293,4 +295,4 @@ public class OpenRoadmInterfaces {
         }
         return null;
     }
-}
\ No newline at end of file
+}