X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=transportpce.git;a=blobdiff_plain;f=renderer%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Frenderer%2Fopenroadminterface%2FOpenRoadmInterfaceFactory.java;h=c21ee1fa1548c8b732530b8d0d164c7252f61f97;hp=0b7b5b9cdc3f6f6f1c57026b68e47694876596d7;hb=67763b4d82e44c68fdbc765cdeec5496ff65b01e;hpb=04b9194abd5955a6ce7334a25ee55aa18ed2e776 diff --git a/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterfaceFactory.java b/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterfaceFactory.java index 0b7b5b9cd..c21ee1fa1 100644 --- a/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterfaceFactory.java +++ b/renderer/src/main/java/org/opendaylight/transportpce/renderer/openroadminterface/OpenRoadmInterfaceFactory.java @@ -11,10 +11,11 @@ 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.rev200429.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.opendaylight.transportpce.portmapping.rev210315.mapping.Mapping; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -26,13 +27,16 @@ public class OpenRoadmInterfaceFactory { private final MappingUtils mappingUtils; private final OpenRoadmInterface121 openRoadmInterface121; private final OpenRoadmInterface221 openRoadmInterface221; + private final OpenRoadmInterface710 openRoadmInterface710; private final OpenRoadmOtnInterface221 openRoadmOtnInterface; public OpenRoadmInterfaceFactory(MappingUtils mappingUtils, OpenRoadmInterface121 openRoadmInterface121, - OpenRoadmInterface221 openRoadmInterface221, OpenRoadmOtnInterface221 openRoadmOTNInterface) { + OpenRoadmInterface221 openRoadmInterface221, OpenRoadmInterface710 openRoadmInterface710, + OpenRoadmOtnInterface221 openRoadmOTNInterface) { this.mappingUtils = mappingUtils; this.openRoadmInterface121 = openRoadmInterface121; this.openRoadmInterface221 = openRoadmInterface221; + this.openRoadmInterface710 = openRoadmInterface710; this.openRoadmOtnInterface = openRoadmOTNInterface; } @@ -44,45 +48,53 @@ public class OpenRoadmInterfaceFactory { return openRoadmInterface121.createOpenRoadmEthInterface(nodeId, logicalConnPoint); case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1: return openRoadmInterface221.createOpenRoadmEthInterface(nodeId, logicalConnPoint); + case StringConstants.OPENROADM_DEVICE_VERSION_7_1_0: + return openRoadmInterface710.createOpenRoadmEthInterface(nodeId, logicalConnPoint); default: return null; } } - - /** - * This methods creates an OCH interface on the given termination point on - * Roadm. - * - * @param nodeId node ID - * @param logicalConnPoint logical connection point - * @param waveNumber wavelength number of the OCH interface. - * @return Name of the interface if successful, otherwise return null. - * @throws OpenRoadmInterfaceException OpenRoadm interface exception - */ - - public List createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber) + public List createOpenRoadmOchInterfaces(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); + return openRoadmInterface121.createOpenRoadmOchInterfaces(nodeId, logicalConnPoint, + spectrumInformation); case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1: - return openRoadmInterface221.createFlexOCH(nodeId, logicalConnPoint, waveNumber); + return openRoadmInterface221.createFlexOCH(nodeId, logicalConnPoint, spectrumInformation); default: return null; } } - public String createOpenRoadmOchInterface(String nodeId, String logicalConnPoint, Long waveNumber, - OchAttributes.ModulationFormat format) - throws OpenRoadmInterfaceException { + /** + * This methods creates an OCH interface on the given termination point on Roadm. + * + * @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 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, format); + return openRoadmInterface121.createOpenRoadmOchInterface(nodeId, logicalConnPoint, + spectrumInformation); case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1: - return openRoadmInterface221.createOpenRoadmOchInterface(nodeId, logicalConnPoint, waveNumber); + return openRoadmInterface221.createOpenRoadmOchInterface(nodeId, logicalConnPoint, + spectrumInformation); + case StringConstants.OPENROADM_DEVICE_VERSION_7_1_0: + // 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; } @@ -107,6 +119,45 @@ public class OpenRoadmInterfaceFactory { case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1: return openRoadmInterface221.createOpenRoadmOdu4Interface(nodeId, logicalConnPoint, supportingOtuInterface); + case StringConstants.OPENROADM_DEVICE_VERSION_7_1_0: + // Here ODUCn and ODUflex are combined + String interfaceNameOduc4 = openRoadmInterface710.createOpenRoadmOducnInterface(nodeId, + logicalConnPoint, supportingOtuInterface); + return openRoadmInterface710.createOpenRoadmOduflexInterface(nodeId, logicalConnPoint, + interfaceNameOduc4); + default: + return null; + } + } + + /** + * 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 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, + asupportingOtuInterface); + case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1: + return openRoadmInterface221.createOpenRoadmOdu4Interface(anodeId, alogicalConnPoint, + asupportingOtuInterface, znodeId, zlogicalConnPoint); + case StringConstants.OPENROADM_DEVICE_VERSION_7_1_0: + // 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; } @@ -131,13 +182,47 @@ public class OpenRoadmInterfaceFactory { case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1: return openRoadmInterface221 .createOpenRoadmOtu4Interface(nodeId, logicalConnPoint, supportOchInterface); + case StringConstants.OPENROADM_DEVICE_VERSION_7_1_0: + return openRoadmInterface710.createOpenRoadmOtucnInterface(nodeId, logicalConnPoint, + supportOchInterface); + default: + return null; + } + } + + /** + * This methods creates an OTU interface on the given termination point. + * + * @param anodeId node ID for A side + * @param alogicalConnPoint logical connection point for A side + * @param asupportOchInterface supporting OCH interface + * @param znodeId node ID for the 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 createOpenRoadmOtu4Interface(String anodeId, String alogicalConnPoint, String asupportOchInterface, + String znodeId, String zlogicalConnPoint) + throws OpenRoadmInterfaceException { + switch (mappingUtils.getOpenRoadmVersion(anodeId)) { + case StringConstants.OPENROADM_DEVICE_VERSION_1_2_1: + return openRoadmInterface121.createOpenRoadmOtu4Interface(anodeId, + alogicalConnPoint, asupportOchInterface); + case StringConstants.OPENROADM_DEVICE_VERSION_2_2_1: + return openRoadmInterface221.createOpenRoadmOtu4Interface(anodeId, alogicalConnPoint, + asupportOchInterface, znodeId, zlogicalConnPoint); + case StringConstants.OPENROADM_DEVICE_VERSION_7_1_0: + return openRoadmInterface710.createOpenRoadmOtucnInterface(anodeId, alogicalConnPoint, + asupportOchInterface, znodeId, zlogicalConnPoint); 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 { @@ -175,7 +260,7 @@ public class OpenRoadmInterfaceFactory { } public boolean isUsedByOtnXc(String nodeId, String interfaceName, String xc, - DeviceTransactionManager deviceTransactionManager) { + 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); @@ -270,4 +355,17 @@ public class OpenRoadmInterfaceFactory { 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; + } + } }