Manage ODU4 services over multiple OTU4
[transportpce.git] / renderer / src / main / java / org / opendaylight / transportpce / renderer / openroadminterface / OpenRoadmInterfaceFactory.java
index 51a4e102d3f36dd230b60582c18d4f2f8ae1c2dc..b62ee33fddc9e0e0d366bc2e4d8c4d19c802f005 100644 (file)
@@ -9,36 +9,68 @@
 package org.opendaylight.transportpce.renderer.openroadminterface;
 
 import java.util.List;
-
 import org.opendaylight.transportpce.common.StringConstants;
+import org.opendaylight.transportpce.common.device.DeviceTransactionManager;
+import org.opendaylight.transportpce.common.fixedflex.GridConstant;
+import org.opendaylight.transportpce.common.fixedflex.SpectrumInformation;
 import org.opendaylight.transportpce.common.mapping.MappingUtils;
 import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfaceException;
-import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev170228.network.nodes.Mapping;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.OchAttributes;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.optical.channel.interfaces.rev161014.RateIdentity;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.az.api.info.AEndApiInfo;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.device.renderer.rev211004.az.api.info.ZEndApiInfo;
+import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.portmapping.rev210927.mapping.Mapping;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.common.types.rev200327.OpucnTribSlotDef;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class OpenRoadmInterfaceFactory {
 
+    private static final String OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG =
+            "OTN functions are not supported by Openroadm models 1.2.1";
+    private static  final String OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_2_2_1_MSG =
+            "OTN functions are not supported by Openroadm models 2.2.1";
+    private static final Logger LOG = LoggerFactory.getLogger(OpenRoadmInterfaceFactory.class);
     private final MappingUtils mappingUtils;
     private final OpenRoadmInterface121 openRoadmInterface121;
-    private final OpenRoadmInterface22 openRoadmInterface22;
-
+    private final OpenRoadmInterface221 openRoadmInterface221;
+    private final OpenRoadmInterface710 openRoadmInterface710;
+    private final OpenRoadmOtnInterface221 openRoadmOtnInterface221;
+    private final OpenRoadmOtnInterface710 openRoadmOtnInterface710;
 
     public OpenRoadmInterfaceFactory(MappingUtils mappingUtils, OpenRoadmInterface121 openRoadmInterface121,
-        OpenRoadmInterface22 openRoadmInterface22) {
+            OpenRoadmInterface221 openRoadmInterface221, OpenRoadmInterface710 openRoadmInterface710,
+            OpenRoadmOtnInterface221 openRoadmOTNInterface221, OpenRoadmOtnInterface710 openRoadmOtnInterface710) {
         this.mappingUtils = mappingUtils;
         this.openRoadmInterface121 = openRoadmInterface121;
-        this.openRoadmInterface22 = openRoadmInterface22;
+        this.openRoadmInterface221 = openRoadmInterface221;
+        this.openRoadmInterface710 = openRoadmInterface710;
+        this.openRoadmOtnInterface221 = openRoadmOTNInterface221;
+        this.openRoadmOtnInterface710 = openRoadmOtnInterface710;
     }
 
-    public String createOpenRoadmEthInterface(String nodeId,
-                                              String logicalConnPoint) throws OpenRoadmInterfaceException {
+    public String createOpenRoadmEthInterface(String nodeId, String logicalConnPoint)
+            throws OpenRoadmInterfaceException {
 
         switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
             case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
                 return openRoadmInterface121.createOpenRoadmEthInterface(nodeId, logicalConnPoint);
-            case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
-                return openRoadmInterface22.createOpenRoadmEthInterface(nodeId, logicalConnPoint);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmEthInterface(nodeId, logicalConnPoint);
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                return openRoadmInterface710.createOpenRoadmEthInterface(nodeId, logicalConnPoint);
+            default:
+                return null;
+        }
+    }
+
+    public List<String> createOpenRoadmOchInterfaces(String nodeId, String logicalConnPoint,
+            SpectrumInformation spectrumInformation)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                return openRoadmInterface121.createOpenRoadmOchInterfaces(nodeId, logicalConnPoint,
+                        spectrumInformation);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createFlexOCH(nodeId, logicalConnPoint, spectrumInformation);
             default:
                 return null;
         }
@@ -46,35 +78,59 @@ public class OpenRoadmInterfaceFactory {
 
 
     /**
-     * This methods creates an OCH interface on the given termination point on
-     * Roadm.
+     * This methods creates an OCH interface on the given termination point on Roadm.
      *
-     * @param waveNumber wavelength number of the OCH interface.
+     * @param nodeId           node ID
+     * @param logicalConnPoint logical connection point
+     * @param spectrumInformation spectrum information.
      * @return Name of the interface if successful, otherwise return null.
+     * @throws OpenRoadmInterfaceException OpenRoadm interface exception
      */
-
-    public List<String> createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber)
-        throws OpenRoadmInterfaceException {
-
+    public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint,
+            SpectrumInformation spectrumInformation) throws OpenRoadmInterfaceException {
         switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
             case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
-                return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint,waveNumber);
-            case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
-                return openRoadmInterface22.createFlexOCH(nodeId, logicalConnPoint,waveNumber);
+                return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint,
+                        spectrumInformation);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmOchInterface(nodeId, logicalConnPoint,
+                        spectrumInformation);
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                // In the case of 710 device, we logically combine the OTSi and OTSiGroup interface and represent
+                // as OCh
+                String interfaceOtsiName = openRoadmInterface710.createOpenRoadmOtsiInterface(nodeId, logicalConnPoint,
+                    spectrumInformation);
+                return openRoadmInterface710.createOpenRoadmOtsiGroupInterface(nodeId, logicalConnPoint,
+                    interfaceOtsiName);
             default:
                 return null;
         }
     }
 
+    /**
+     * This methods creates an ODU interface on the given termination point.
+     *
+     * @param nodeId                 node ID
+     * @param logicalConnPoint       logical connection point
+     * @param supportingOtuInterface supporting OTU interface
+     * @return Name of the interface if successful, otherwise return null.
+     * @throws OpenRoadmInterfaceException OpenRoadm interface exception
+     */
 
-    public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber,
-        Class<? extends RateIdentity> rate, OchAttributes.ModulationFormat format) throws OpenRoadmInterfaceException {
+    public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
+            throws OpenRoadmInterfaceException {
         switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
             case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
-                return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber,
-                    rate, format);
-            case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
-                return openRoadmInterface22.createOpenRoadmOchInterface(nodeId,logicalConnPoint,waveNumber);
+                return openRoadmInterface121.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint,
+                        supportingOtuInterface);
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                // Here ODUCn and ODUflex are combined
+                String interfaceNameOduc4 = openRoadmInterface710.createOpenRoadmOducnInterface(nodeId,
+                    logicalConnPoint, supportingOtuInterface);
+                return openRoadmInterface710.createOpenRoadmOduflexInterface(nodeId, logicalConnPoint,
+                    interfaceNameOduc4);
             default:
                 return null;
         }
@@ -83,18 +139,56 @@ public class OpenRoadmInterfaceFactory {
     /**
      * This methods creates an ODU interface on the given termination point.
      *
+     * @param anodeId                 node ID for A side
+     * @param alogicalConnPoint       logical connection point for A side
+     * @param asupportingOtuInterface supporting OTU interface
+     * @param znodeId                 node ID for Z side
+     * @param zlogicalConnPoint       logical connection point for Z side
      * @return Name of the interface if successful, otherwise return null.
+     * @throws OpenRoadmInterfaceException OpenRoadm interface exception
      */
 
-    public String createOpenRoadmOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
+    public String createOpenRoadmOdu4Interface(String anodeId, String alogicalConnPoint, String asupportingOtuInterface,
+            String znodeId, String zlogicalConnPoint)
             throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(anodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                return openRoadmInterface121.createOpenRoadmOdu4Interface(anodeId, alogicalConnPoint);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmOdu4Interface(anodeId, alogicalConnPoint,
+                    asupportingOtuInterface, znodeId, zlogicalConnPoint);
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                // Here ODUCn and ODUflex are combined
+                String interfaceNameOduc4 = openRoadmInterface710.createOpenRoadmOducnInterface(anodeId,
+                    alogicalConnPoint, asupportingOtuInterface, znodeId, zlogicalConnPoint);
+                return openRoadmInterface710.createOpenRoadmOduflexInterface(anodeId, alogicalConnPoint,
+                    interfaceNameOduc4, znodeId, zlogicalConnPoint);
+            default:
+                return null;
+        }
+    }
+
+    /**
+     * This methods creates an ODU interface on the given termination point.
+     *
+     * @param nodeId                 node ID
+     * @param logicalConnPoint       logical connection point
+     * @param isCTP                  to distinguish with a TTP odu interface
+     * @param apiInfoA               sapi and dapi for A end of the service
+     * @param apiInfoZ               sapi and dapi for Z end of the service
+     * @param payload                payload type of the OPU container
+     * @return Name of the interface if successful, otherwise return null.
+     * @throws OpenRoadmInterfaceException OpenRoadm interface exception
+     */
+
+    public String createOpenRoadmOdu4HOInterface(String nodeId, String logicalConnPoint, boolean isCTP,
+            AEndApiInfo apiInfoA, ZEndApiInfo apiInfoZ, String payload) throws OpenRoadmInterfaceException {
         switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
             case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
-                return openRoadmInterface121.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint,
-                    supportingOtuInterface);
-            case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
-                return openRoadmInterface22.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint,
-                    supportingOtuInterface);
+                return openRoadmInterface121.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmOdu4HOInterface(nodeId, logicalConnPoint, isCTP,
+                    apiInfoA, apiInfoZ, payload);
             default:
                 return null;
         }
@@ -103,32 +197,42 @@ public class OpenRoadmInterfaceFactory {
     /**
      * This methods creates an OTU interface on the given termination point.
      *
-     * @return Name of the interface if successful, otherwise return null.
+     * @param nodeId              node ID
+     * @param logicalConnPoint    logical connection point
+     * @param supportOchInterface supporting OCH interface
+     * @param apiInfoA            sapi and dapi for A end of the service
+     * @param apiInfoZ            sapi and dapi for Z end of the service
+     * @throws OpenRoadmInterfaceException OpenRoadm interface exception
      */
 
-    public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface)
-            throws OpenRoadmInterfaceException {
+    public String createOpenRoadmOtu4Interface(String nodeId, String logicalConnPoint, String supportOchInterface,
+            AEndApiInfo apiInfoA, ZEndApiInfo apiInfoZ) throws OpenRoadmInterfaceException {
         switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
             case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
-                return openRoadmInterface121.createOpenRoadmOtu4Interface(nodeId,
-                    logicalConnPoint,supportOchInterface);
-            case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
-                return openRoadmInterface22.createOpenRoadmOtu4Interface(nodeId,logicalConnPoint, supportOchInterface);
+                return openRoadmInterface121
+                        .createOpenRoadmOtu4Interface(nodeId, logicalConnPoint, supportOchInterface);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmOtu4Interface(nodeId, logicalConnPoint, supportOchInterface,
+                    apiInfoA, apiInfoZ);
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                return openRoadmInterface710.createOpenRoadmOtucnInterface(nodeId, logicalConnPoint,
+                    supportOchInterface);
             default:
                 return null;
         }
     }
 
-    public String createOpenRoadmOchInterfaceName(String logicalConnectionPoint, Long waveNumber) {
-        return logicalConnectionPoint + "-" + waveNumber;
+
+    public String createOpenRoadmOchInterfaceName(String logicalConnectionPoint, String spectralSlotNumber) {
+        return String.join(GridConstant.NAME_PARAMETERS_SEPARATOR,logicalConnectionPoint, spectralSlotNumber);
     }
 
     public String createOpenRoadmOmsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
         switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
             case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
-                return openRoadmInterface121.createOpenRoadmOmsInterface(nodeId,mapping);
-            case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
-                return openRoadmInterface22.createOpenRoadmOmsInterface(nodeId,mapping);
+                return openRoadmInterface121.createOpenRoadmOmsInterface(nodeId, mapping);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmOmsInterface(nodeId, mapping);
             default:
                 return null;
         }
@@ -137,16 +241,196 @@ public class OpenRoadmInterfaceFactory {
     public String createOpenRoadmOtsInterface(String nodeId, Mapping mapping) throws OpenRoadmInterfaceException {
         switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
             case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
-                return openRoadmInterface121.createOpenRoadmOtsInterface(nodeId,mapping);
-            case StringConstants.OPENROADM_DEVICE_VERSION_2_2:
-                return openRoadmInterface22.createOpenRoadmOtsInterface(nodeId,mapping);
+                return openRoadmInterface121.createOpenRoadmOtsInterface(nodeId, mapping);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.createOpenRoadmOtsInterface(nodeId, mapping);
+            default:
+                return null;
+        }
+    }
+
+    public boolean isUsedByXc(String nodeId, String interfaceName, String xc,
+            DeviceTransactionManager deviceTransactionManager) {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                return openRoadmInterface121.isUsedByXc(nodeId, interfaceName, xc, deviceTransactionManager);
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.isUsedByXc(nodeId, interfaceName, xc, deviceTransactionManager);
+            default:
+                return false;
+        }
+    }
+
+    public boolean isUsedByOtnXc(String nodeId, String interfaceName, String xc,
+            DeviceTransactionManager deviceTransactionManager) {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return false;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221.isUsedByOtnXc(nodeId, interfaceName, xc, deviceTransactionManager);
+            default:
+                return false;
+        }
+    }
+
+    public String createOpenRoadmEth1GInterface(String nodeId,
+            String logicalConnPoint) throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmOtnInterface221.createOpenRoadmEth1GInterface(nodeId, logicalConnPoint);
+            default:
+                return null;
+        }
+    }
+
+    public String createOpenRoadmEth10GInterface(String nodeId,
+            String logicalConnPoint) throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmOtnInterface221.createOpenRoadmEth10GInterface(nodeId, logicalConnPoint);
+            default:
+                return null;
+        }
+
+    }
+
+    public String createOpenRoadmEth100GInterface(String nodeId,
+            String logicalConnPoint) throws OpenRoadmInterfaceException {
+
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                LOG.warn("Use Ethernet interface creation for 2.2.1, instead this method of Ether 100G");
+                return openRoadmInterface221.createOpenRoadmEthInterface(nodeId, logicalConnPoint);
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                return openRoadmOtnInterface710.createOpenRoadmEth100GInterface(nodeId, logicalConnPoint);
+            default:
+                return null;
+        }
+
+    }
+
+    public String createOpenRoadmOdu0Interface(String nodeId, String logicalConnPoint, String servicename,
+            String payLoad, boolean isNetworkPort, int tribPortNumber, int tribSlot)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmOtnInterface221.createOpenRoadmOdu0Interface(
+                    nodeId, logicalConnPoint, servicename, payLoad, isNetworkPort, tribPortNumber, tribSlot);
+            default:
+                return null;
+        }
+    }
+
+    public String createOpenRoadmOdu2Interface(String nodeId, String logicalConnPoint, String servicename,
+            String payLoad, boolean isNetworkPort, int tribPortNumber, int tribSlotIndex)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmOtnInterface221.createOpenRoadmOdu2Interface(
+                    nodeId, logicalConnPoint, servicename, payLoad, isNetworkPort, tribPortNumber, tribSlotIndex);
+            default:
+                return null;
+        }
+    }
+
+    public String createOpenRoadmOdu2eInterface(String nodeId, String logicalConnPoint, String servicename,
+            boolean isCTP, int tribPortNumber, int tribSlotIndex, AEndApiInfo apiInfoA, ZEndApiInfo apiInfoZ)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmOtnInterface221.createOpenRoadmOdu2eInterface(nodeId, logicalConnPoint, servicename,
+                    isCTP, tribPortNumber, tribSlotIndex, apiInfoA, apiInfoZ);
             default:
                 return null;
         }
+
     }
 
+    public String createOpenRoadmOtnOdu4LoInterface(String nodeId, String logicalConnPoint,
+        String serviceName, String payLoad, boolean isNetworkPort,
+        OpucnTribSlotDef minTribSlotNumber, OpucnTribSlotDef maxTribSlotNumber)
+        throws OpenRoadmInterfaceException {
 
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_1_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                LOG.error(OTN_FUNTIONS_ARE_NOT_SUPPORTED_BY_OPENROADM_MODELS_2_2_1_MSG);
+                return null;
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                return openRoadmOtnInterface710.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint, serviceName,
+                    payLoad, isNetworkPort, minTribSlotNumber, maxTribSlotNumber);
+            default:
+                return null;
+        }
+    }
+
+    public String createOpenRoadmOtnOdu4Interface(String nodeId, String logicalConnPoint, String supportingOtuInterface)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221
+                        .createOpenRoadmOtnOdu4Interface(nodeId, logicalConnPoint, supportingOtuInterface);
+            default:
+                return null;
+        }
+    }
 
+    public String createOpenRoadmOtnOdu4Interface(String anodeId, String alogicalConnPoint,
+            String asupportingOtuInterface, String znodeId, String zlogicalConnPoint)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(anodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1:
+                return openRoadmInterface221
+                    .createOpenRoadmOtnOdu4Interface(anodeId, alogicalConnPoint, asupportingOtuInterface,
+                        znodeId, zlogicalConnPoint);
+            default:
+                return null;
+        }
+    }
 
+    public String createOpenRoadmOtnOduc4Interface(String nodeId, String logicalConnPoint,
+            String supportingOtuInterface)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(nodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                return openRoadmInterface710
+                    .createOpenRoadmOtnOducnInterface(nodeId, logicalConnPoint, supportingOtuInterface);
+            default:
+                return null;
+        }
+    }
 
+    public String createOpenRoadmOtnOduc4Interface(String anodeId, String alogicalConnPoint,
+            String asupportingOtuInterface, String znodeId, String zlogicalConnPoint)
+            throws OpenRoadmInterfaceException {
+        switch (mappingUtils.getOpenRoadmVersion(anodeId)) {
+            case StringConstants.OPENROADM_DEVICE_VERSION_7_1:
+                return openRoadmInterface710
+                    .createOpenRoadmOtnOducnInterface(anodeId, alogicalConnPoint, asupportingOtuInterface,
+                        znodeId, zlogicalConnPoint);
+            default:
+                return null;
+        }
+    }
 }