Use version 13.1.0 of openroadm-network models
[transportpce.git] / tapi / src / main / java / org / opendaylight / transportpce / tapi / topology / ConvertORTopoToTapiTopo.java
index ad6106b07a037b7132e54e98149aa6e8bfae7ca6..8fe16f870a7f547d30e7e22e119c3a3aff0aa182 100644 (file)
@@ -9,7 +9,6 @@ package org.opendaylight.transportpce.tapi.topology;
 
 import java.nio.charset.Charset;
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
@@ -23,19 +22,19 @@ import java.util.UUID;
 import java.util.stream.Collectors;
 import org.opendaylight.transportpce.tapi.TapiStringConstants;
 import org.opendaylight.transportpce.tapi.utils.TapiLink;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Link1;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.TerminationPoint1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Link1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.TerminationPoint1;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
 import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev200327.xpdr.odu.switching.pools.OduSwitchingPools;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev200327.xpdr.odu.switching.pools.OduSwitchingPoolsBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev200327.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingList;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev200327.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingListBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev200327.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingListKey;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmNodeType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.OpenroadmTpType;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev200529.xpdr.tp.supported.interfaces.SupportedInterfaceCapability;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev200529.Node1;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev230526.xpdr.odu.switching.pools.OduSwitchingPools;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev230526.xpdr.odu.switching.pools.OduSwitchingPoolsBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev230526.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingList;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev230526.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingListBuilder;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.topology.types.rev230526.xpdr.odu.switching.pools.odu.switching.pools.NonBlockingListKey;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmNodeType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.OpenroadmTpType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.network.types.rev230526.xpdr.tp.supported.interfaces.SupportedInterfaceCapability;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev230526.Node1;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.rev180226.networks.network.Node;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.TpId;
 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.networks.network.node.TerminationPoint;
@@ -115,20 +114,20 @@ public class ConvertORTopoToTapiTopo {
 
     public void convertNode(Node ietfNode, List<String> networkPorts) {
         this.ietfNodeId = ietfNode.getNodeId().getValue();
-        if (ietfNode.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Node1.class)
+        if (ietfNode.augmentation(org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1.class)
                 == null) {
             return;
         }
         this.ietfNodeType = ietfNode.augmentation(
-            org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Node1.class).getNodeType();
+            org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1.class).getNodeType();
         this.ietfNodeAdminState = ietfNode.augmentation(
-            org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Node1.class)
+                org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1.class)
             .getAdministrativeState();
         this.ietfNodeOperState = ietfNode.augmentation(
-            org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev200529.Node1.class)
+                org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.Node1.class)
             .getOperationalState();
         this.oorNetworkPortList = ietfNode.augmentation(
-            org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
+                org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
             .getTerminationPoint().values().stream()
             .filter(tp -> tp.augmentation(TerminationPoint1.class).getTpType().getIntValue()
                 == OpenroadmTpType.XPONDERNETWORK.getIntValue()
@@ -137,7 +136,7 @@ public class ConvertORTopoToTapiTopo {
             .collect(Collectors.toList());
         if (!OpenroadmNodeType.TPDR.equals(this.ietfNodeType)) {
             this.oorOduSwitchingPool = ietfNode.augmentation(Node1.class).getSwitchingPools().getOduSwitchingPools()
-                .values().stream().findFirst().get();
+                .values().stream().findFirst().orElseThrow();
             this.oorClientPortList = ietfNode.augmentation(
                 org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.network.topology.rev180226.Node1.class)
                 .getTerminationPoint().values().stream()
@@ -165,10 +164,14 @@ public class ConvertORTopoToTapiTopo {
         Uuid nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", this.ietfNodeId,
             TapiStringConstants.DSR)).getBytes(Charset.forName("UTF-8"))).toString());
         this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.DSR), nodeUuid);
-        Name nameDsr = new NameBuilder().setValueName("dsr/odu node name").setValue(this.ietfNodeId).build();
-        List<LayerProtocolName> dsrLayerProtocols = Arrays.asList(LayerProtocolName.DSR, LayerProtocolName.ODU);
+        Name nameDsr = new NameBuilder().setValueName("dsr/odu node name")
+            .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.DSR)).build();
+        Name nameNodeType = new NameBuilder().setValueName("Node Type")
+            .setValue(this.ietfNodeType.getName()).build();
+        Set<LayerProtocolName> dsrLayerProtocols = Set.of(LayerProtocolName.DSR, LayerProtocolName.ODU);
         org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology
-            .Node dsrNode = createTapiNode(Map.of(nameDsr.key(), nameDsr), dsrLayerProtocols);
+            .Node dsrNode = createTapiNode(Map.of(nameDsr.key(), nameDsr, nameNodeType.key(), nameNodeType),
+            dsrLayerProtocols);
         tapiNodes.put(dsrNode.key(), dsrNode);
 
         // node creation [otsi]
@@ -176,10 +179,12 @@ public class ConvertORTopoToTapiTopo {
         nodeUuid = new Uuid(UUID.nameUUIDFromBytes((String.join("+", this.ietfNodeId, TapiStringConstants.OTSI))
             .getBytes(Charset.forName("UTF-8"))).toString());
         this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.OTSI), nodeUuid);
-        Name nameOtsi =  new NameBuilder().setValueName("otsi node name").setValue(this.ietfNodeId).build();
-        List<LayerProtocolName> otsiLayerProtocols = Arrays.asList(LayerProtocolName.PHOTONICMEDIA);
+        Name nameOtsi =  new NameBuilder().setValueName("otsi node name")
+            .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.OTSI)).build();
+        Set<LayerProtocolName> otsiLayerProtocols = Set.of(LayerProtocolName.PHOTONICMEDIA);
         org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology
-            .Node otsiNode = createTapiNode(Map.of(nameOtsi.key(), nameOtsi), otsiLayerProtocols);
+            .Node otsiNode = createTapiNode(Map.of(nameOtsi.key(), nameOtsi, nameNodeType.key(), nameNodeType),
+            otsiLayerProtocols);
         tapiNodes.put(otsiNode.key(), otsiNode);
 
         // transitional link cration between network nep of DSR/ODU node and iNep of otsi node
@@ -235,8 +240,8 @@ public class ConvertORTopoToTapiTopo {
                 Link tapLink = this.tapiLink.createTapiLink(otnlink.getSource().getSourceNode().getValue(),
                     otnlink.getSource().getSourceTp().getValue(), otnlink.getDestination().getDestNode().getValue(),
                     otnlink.getDestination().getDestTp().getValue(), TapiStringConstants.OTN_XPDR_XPDR_LINK, nodesQual,
-                    nodesQual, tpsQual, tpsQual, adminState, operState, List.of(layerProtocolName),
-                    List.of(layerProtocolName.getName()), this.tapiTopoUuid);
+                    nodesQual, tpsQual, tpsQual, adminState, operState, Set.of(layerProtocolName),
+                    Set.of(layerProtocolName.getName()), this.tapiTopoUuid);
                 linksToNotConvert.add(oppositeLinkId);
                 tapiLinks.put(tapLink.key(), tapLink);
             }
@@ -249,7 +254,9 @@ public class ConvertORTopoToTapiTopo {
             .getBytes(Charset.forName("UTF-8"))).toString());
         Name nodeName =  new NameBuilder().setValueName("otsi node name").setValue(TapiStringConstants.RDM_INFRA)
             .build();
-        List<LayerProtocolName> nodeLayerProtocols = Arrays.asList(LayerProtocolName.PHOTONICMEDIA);
+        Name nameNodeType = new NameBuilder().setValueName("Node Type")
+            .setValue(OpenroadmNodeType.ROADM.getName()).build();
+        Set<LayerProtocolName> nodeLayerProtocols = Set.of(LayerProtocolName.PHOTONICMEDIA);
 
         List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node> tapiPhotonicNodes
             = pruneTapiPhotonicNodes();
@@ -262,7 +269,7 @@ public class ConvertORTopoToTapiTopo {
         // build RDM infra node abstraction
         org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node rdmNode = new NodeBuilder()
             .setUuid(nodeUuid)
-            .setName(Map.of(nodeName.key(), nodeName))
+            .setName(Map.of(nodeName.key(), nodeName, nameNodeType.key(), nameNodeType))
             .setLayerProtocolName(nodeLayerProtocols)
             .setAdministrativeState(AdministrativeState.UNLOCKED)
             .setOperationalState(OperationalState.ENABLED)
@@ -286,10 +293,10 @@ public class ConvertORTopoToTapiTopo {
         int count = 1;
         for (TerminationPoint tp : this.oorNetworkPortList) {
             TpId tpid1 = tp.getTpId();
-            TpId tpid2 = new TpId(tp.augmentation(
-                    org.opendaylight.yang.gen.v1.http.transportpce.topology.rev210511.TerminationPoint1.class)
-                .getAssociatedConnectionMapPort());
-            List<TpId> tpList = new ArrayList<>();
+            TpId tpid2 = tp.augmentation(
+                    org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev230526.TerminationPoint1.class)
+                .getAssociatedConnectionMapTp().iterator().next();
+            Set<TpId> tpList = new HashSet<>();
             tpList.add(tpid1);
             tpList.add(tpid2);
             NonBlockingList nbl = new NonBlockingListBuilder()
@@ -311,14 +318,15 @@ public class ConvertORTopoToTapiTopo {
             prunedTapiPhotonicNodes = new ArrayList<>();
         List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node> tapiPhotonicNodes
             = this.tapiNodes.values().stream()
-                .filter(n -> LayerProtocolName.PHOTONICMEDIA.equals(n.getLayerProtocolName().get(0)))
-                .collect(Collectors.toList());
+            .filter(n -> LayerProtocolName.PHOTONICMEDIA.equals(n.getLayerProtocolName().stream().findFirst()
+                    .orElseThrow()))
+            .collect(Collectors.toList());
         for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node
-                : tapiPhotonicNodes) {
+            : tapiPhotonicNodes) {
             Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepM = new HashMap<>();
             for (Map.Entry<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> entry : node.getOwnedNodeEdgePoint().entrySet()) {
                 if (entry.getValue().getName().values().stream()
-                        .filter(name -> name.getValueName().startsWith("eNodeEdgePoint")).count() > 0) {
+                    .filter(name -> name.getValueName().startsWith("eNodeEdgePoint")).count() > 0) {
                     onepM.put(entry.getKey(), entry.getValue());
                 }
             }
@@ -330,14 +338,15 @@ public class ConvertORTopoToTapiTopo {
     }
 
     private Map<String, String> convertListNodeWithListNepToMapForUuidAndName(
-            List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node> nodes) {
+        List<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node> nodes) {
         Map<String, String> uuidNameMap = new HashMap<>();
         for (org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node node : nodes) {
             for (OwnedNodeEdgePoint nep : node.nonnullOwnedNodeEdgePoint().values()) {
                 String nodeUuid = node.getUuid().getValue();
                 String nepUuid = nep.getUuid().getValue();
                 String nodeName = node.getName().get(new NameKey("otsi node name")).getValue();
-                String nepName = nep.getName().get(new NameKey(nep.getName().keySet().stream().findFirst().get()))
+                String nepName = nep.getName().get(new NameKey(nep.getName().keySet().stream().findFirst()
+                        .orElseThrow()))
                     .getValue();
                 uuidNameMap.put(String.join("--", nodeUuid, nepUuid), String.join("--", nodeName, nepName));
             }
@@ -346,7 +355,7 @@ public class ConvertORTopoToTapiTopo {
     }
 
     private org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.topology.Node
-            createTapiNode(Map<NameKey, Name> nodeNames, List<LayerProtocolName> layerProtocols) {
+            createTapiNode(Map<NameKey, Name> nodeNames, Set<LayerProtocolName> layerProtocols) {
         Uuid nodeUuid = null;
         Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepl = new HashMap<>();
         Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupList = new HashMap<>();
@@ -378,20 +387,22 @@ public class ConvertORTopoToTapiTopo {
     }
 
     private Uuid getNodeUuid4Photonic(Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepl,
-            Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupList, Map<RuleKey, Rule> ruleList) {
+                                      Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupList,
+                                      Map<RuleKey, Rule> ruleList) {
         Uuid nodeUuid;
         nodeUuid = this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.OTSI));
         // iNep creation on otsi node
         for (int i = 0; i < oorNetworkPortList.size(); i++) {
             Uuid nepUuid1 = new Uuid(UUID.nameUUIDFromBytes(
-                (String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
-                    oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8")))
+                    (String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
+                        oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8")))
                 .toString());
             this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
                 oorNetworkPortList.get(i).getTpId().getValue()), nepUuid1);
             Name onedName = new NameBuilder()
                 .setValueName("iNodeEdgePoint")
-                .setValue(oorNetworkPortList.get(i).getTpId().getValue())
+                .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.I_OTSI,
+                    oorNetworkPortList.get(i).getTpId().getValue()))
                 .build();
 
             OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
@@ -402,14 +413,15 @@ public class ConvertORTopoToTapiTopo {
         // eNep creation on otsi node
         for (int i = 0; i < oorNetworkPortList.size(); i++) {
             Uuid nepUuid2 = new Uuid(UUID.nameUUIDFromBytes(
-                (String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
-                    oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8")))
+                    (String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
+                        oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8")))
                 .toString());
             this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
                 oorNetworkPortList.get(i).getTpId().getValue()), nepUuid2);
             Name onedName = new NameBuilder()
                 .setValueName("eNodeEdgePoint")
-                .setValue(oorNetworkPortList.get(i).getTpId().getValue())
+                .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.E_OTSI,
+                    oorNetworkPortList.get(i).getTpId().getValue()))
                 .build();
 
             OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
@@ -456,7 +468,7 @@ public class ConvertORTopoToTapiTopo {
     }
 
     private Uuid getNodeUuid4Dsr(Map<OwnedNodeEdgePointKey, OwnedNodeEdgePoint> onepl,
-            Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupList, Map<RuleKey, Rule> ruleList) {
+                                 Map<NodeRuleGroupKey, NodeRuleGroup> nodeRuleGroupList, Map<RuleKey, Rule> ruleList) {
         Uuid nodeUuid;
         nodeUuid = this.uuidMap.get(String.join("+", this.ietfNodeId, TapiStringConstants.DSR));
         // client nep creation on DSR/ODU node
@@ -466,7 +478,8 @@ public class ConvertORTopoToTapiTopo {
                     oorClientPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8"))).toString());
             this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
                 oorClientPortList.get(i).getTpId().getValue()), nepUuid);
-            NameBuilder nameBldr = new NameBuilder().setValue(oorClientPortList.get(i).getTpId().getValue());
+            NameBuilder nameBldr = new NameBuilder().setValue(String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
+                oorClientPortList.get(i).getTpId().getValue()));
             Name name;
             if (OpenroadmNodeType.TPDR.equals(this.ietfNodeType)) {
                 name = nameBldr.setValueName("100G-tpdr").build();
@@ -482,18 +495,19 @@ public class ConvertORTopoToTapiTopo {
         // network nep creation on DSR/ODU node
         for (int i = 0; i < oorNetworkPortList.size(); i++) {
             Uuid nepUuid = new Uuid(UUID.nameUUIDFromBytes(
-                (String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
+                (String.join("+", this.ietfNodeId, TapiStringConstants.I_ODU,
                     oorNetworkPortList.get(i).getTpId().getValue())).getBytes(Charset.forName("UTF-8"))).toString());
-            this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
+            this.uuidMap.put(String.join("+", this.ietfNodeId, TapiStringConstants.I_ODU,
                 oorNetworkPortList.get(i).getTpId().getValue()), nepUuid);
             Name onedName = new NameBuilder()
-                .setValueName("NodeEdgePoint_N")
-                .setValue(oorNetworkPortList.get(i).getTpId().getValue())
+                .setValueName("iNodeEdgePoint_N")
+                .setValue(String.join("+", this.ietfNodeId, TapiStringConstants.I_ODU,
+                    oorNetworkPortList.get(i).getTpId().getValue()))
                 .build();
 
             OwnedNodeEdgePoint onep = createNep(oorNetworkPortList.get(i), Map.of(onedName.key(), onedName),
                 LayerProtocolName.ODU, LayerProtocolName.DSR, true, String.join("+", this.ietfNodeId,
-                    TapiStringConstants.DSR));
+                    TapiStringConstants.I_ODU));
             onepl.put(onep.key(), onep);
         }
         // create NodeRuleGroup
@@ -504,8 +518,10 @@ public class ConvertORTopoToTapiTopo {
                 nepList = new HashMap<>();
             for (TpId tp : nbl.getTpList()) {
                 if (this.uuidMap.containsKey(String.join("+", this.ietfNodeId, TapiStringConstants.DSR,
-                    tp.getValue()))) {
-
+                        tp.getValue())) || this.uuidMap.containsKey(String.join(
+                    "+", this.ietfNodeId, TapiStringConstants.I_ODU, tp.getValue()))) {
+                    String qual = tp.getValue().contains("CLIENT") ? TapiStringConstants.DSR
+                        : TapiStringConstants.I_ODU;
                     org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint
                         nep = new org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group
                         .NodeEdgePointBuilder()
@@ -513,7 +529,7 @@ public class ConvertORTopoToTapiTopo {
                         .setNodeUuid(this.uuidMap.get(String.join("+", this.ietfNodeId,
                             TapiStringConstants.DSR)))
                         .setNodeEdgePointUuid(this.uuidMap.get(String.join("+", this.ietfNodeId,
-                            TapiStringConstants.DSR, tp.getValue())))
+                            qual, tp.getValue())))
                         .build();
                     nepList.put(nep.key(), nep);
                 }
@@ -532,7 +548,8 @@ public class ConvertORTopoToTapiTopo {
     }
 
     private OwnedNodeEdgePoint createNep(TerminationPoint oorTp, Map<NameKey, Name> nepNames,
-            LayerProtocolName nepProtocol, LayerProtocolName nodeProtocol, boolean withSip, String keyword) {
+                                         LayerProtocolName nepProtocol, LayerProtocolName nodeProtocol,
+                                         boolean withSip, String keyword) {
         String key = String.join("+", keyword, oorTp.getTpId().getValue());
         AdministrativeState adminState = (oorTp.augmentation(TerminationPoint1.class).getAdministrativeState() != null)
             ? this.tapiLink.setTapiAdminState(oorTp.augmentation(TerminationPoint1.class).getAdministrativeState()
@@ -573,7 +590,7 @@ public class ConvertORTopoToTapiTopo {
                 .setUuid(nepUuid)
                 .setLayerProtocolName(LayerProtocolName.PHOTONICMEDIA)
                 .setName(Map.of(nepName.key(), nepName))
-                .setSupportedCepLayerProtocolQualifier(List.of(PHOTONICLAYERQUALIFIEROMS.class))
+                .setSupportedCepLayerProtocolQualifier(Set.of(PHOTONICLAYERQUALIFIEROMS.VALUE))
                 .setLinkPortDirection(PortDirection.BIDIRECTIONAL).setLinkPortRole(PortRole.SYMMETRIC)
                 .setAdministrativeState(AdministrativeState.UNLOCKED).setOperationalState(OperationalState.ENABLED)
                 .setLifecycleState(LifecycleState.INSTALLED).setTerminationDirection(TerminationDirection.BIDIRECTIONAL)
@@ -585,7 +602,7 @@ public class ConvertORTopoToTapiTopo {
     }
 
     private Map<NodeRuleGroupKey, NodeRuleGroup> createNodeRuleGroupForRdmNode(Uuid nodeUuid,
-            Collection<OwnedNodeEdgePoint> onepl) {
+                                                                               Collection<OwnedNodeEdgePoint> onepl) {
         Map<org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePointKey,
             org.opendaylight.yang.gen.v1.urn.onf.otcc.yang.tapi.topology.rev181210.node.rule.group.NodeEdgePoint>
             nepMap = new HashMap<>();
@@ -618,7 +635,7 @@ public class ConvertORTopoToTapiTopo {
     }
 
     private Map<MappedServiceInterfacePointKey, MappedServiceInterfacePoint> createSIP(int nb, TerminationPoint tp,
-            String nodeId) {
+                                                                                       String nodeId) {
         Map<MappedServiceInterfacePointKey, MappedServiceInterfacePoint> msipl = new HashMap<>();
         for (int i = 0; i < nb; i++) {
             MappedServiceInterfacePoint msip = new MappedServiceInterfacePointBuilder()
@@ -630,38 +647,39 @@ public class ConvertORTopoToTapiTopo {
         return msipl;
     }
 
-    private List<Class<? extends LAYERPROTOCOLQUALIFIER>> createSupportedCepLayerProtocolQualifier(TerminationPoint tp,
-            LayerProtocolName lpn) {
-        Set<Class<? extends LAYERPROTOCOLQUALIFIER>> sclpqSet = new HashSet<>();
-        List<SupportedInterfaceCapability> sicList = new ArrayList<>(
-            tp.augmentation(org.opendaylight.yang.gen.v1.http
-                .org.openroadm.otn.network.topology.rev200529.TerminationPoint1.class).getTpSupportedInterfaces()
-                .getSupportedInterfaceCapability().values());
+    private Set<LAYERPROTOCOLQUALIFIER>
+            createSupportedCepLayerProtocolQualifier(TerminationPoint tp, LayerProtocolName lpn) {
+        Set<LAYERPROTOCOLQUALIFIER> sclpqSet = new HashSet<>();
+        Collection<SupportedInterfaceCapability> sicList = tp.augmentation(
+                org.opendaylight.yang.gen.v1.http.org.openroadm.otn.network.topology.rev230526.TerminationPoint1.class)
+            .getTpSupportedInterfaces()
+            .getSupportedInterfaceCapability().values();
         for (SupportedInterfaceCapability sic : sicList) {
+            String ifCapType = sic.getIfCapType().toString().split("\\{")[0];
             switch (lpn.getName()) {
                 case "DSR":
-                    switch (sic.getIfCapType().getSimpleName()) {
+                    switch (ifCapType) {
                         case "If10GEODU2e":
-                            sclpqSet.add(ODUTYPEODU2E.class);
-                            sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.class);
+                            sclpqSet.add(ODUTYPEODU2E.VALUE);
+                            sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.VALUE);
                             break;
                         case "If10GEODU2":
-                            sclpqSet.add(ODUTYPEODU2.class);
-                            sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.class);
+                            sclpqSet.add(ODUTYPEODU2.VALUE);
+                            sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.VALUE);
                             break;
                         case "If10GE":
-                            sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.class);
+                            sclpqSet.add(DIGITALSIGNALTYPE10GigELAN.VALUE);
                             break;
                         case "If100GEODU4":
-                            sclpqSet.add(DIGITALSIGNALTYPE100GigE.class);
-                            sclpqSet.add(ODUTYPEODU4.class);
+                            sclpqSet.add(DIGITALSIGNALTYPE100GigE.VALUE);
+                            sclpqSet.add(ODUTYPEODU4.VALUE);
                             break;
                         case "If100GE":
-                            sclpqSet.add(DIGITALSIGNALTYPE100GigE.class);
+                            sclpqSet.add(DIGITALSIGNALTYPE100GigE.VALUE);
                             break;
                         case "IfOCHOTU4ODU4":
                         case "IfOCH":
-                            sclpqSet.add(ODUTYPEODU4.class);
+                            sclpqSet.add(ODUTYPEODU4.VALUE);
                             break;
                         default:
                             LOG.error("IfCapability type not managed");
@@ -669,10 +687,9 @@ public class ConvertORTopoToTapiTopo {
                     }
                     break;
                 case "PHOTONIC_MEDIA":
-                    if (sic.getIfCapType().getSimpleName().equals("IfOCHOTU4ODU4")
-                            || sic.getIfCapType().getSimpleName().equals("IfOCH")) {
-                        sclpqSet.add(PHOTONICLAYERQUALIFIEROTSi.class);
-                        sclpqSet.add(PHOTONICLAYERQUALIFIEROMS.class);
+                    if (ifCapType.equals("IfOCHOTU4ODU4") || ifCapType.equals("IfOCH")) {
+                        sclpqSet.add(PHOTONICLAYERQUALIFIEROTSi.VALUE);
+                        sclpqSet.add(PHOTONICLAYERQUALIFIEROMS.VALUE);
                     }
                     break;
                 default:
@@ -680,17 +697,16 @@ public class ConvertORTopoToTapiTopo {
                     break;
             }
         }
-        return new ArrayList<>(sclpqSet);
+        return sclpqSet;
     }
 
     private void createTapiTransitionalLinks() {
         for (TerminationPoint tp : this.oorNetworkPortList) {
             Link transiLink = tapiLink.createTapiLink(this.ietfNodeId, tp.getTpId().getValue(), this.ietfNodeId,
                 tp.getTpId().getValue(), TapiStringConstants.TRANSITIONAL_LINK, TapiStringConstants.DSR,
-                TapiStringConstants.OTSI, TapiStringConstants.DSR, TapiStringConstants.I_OTSI,
-                "inService", "inService", Arrays.asList(LayerProtocolName.ODU,
-                    LayerProtocolName.PHOTONICMEDIA),
-                Arrays.asList(LayerProtocolName.ODU.getName(), LayerProtocolName.PHOTONICMEDIA.getName()),
+                TapiStringConstants.OTSI, TapiStringConstants.I_ODU, TapiStringConstants.I_OTSI,
+                "inService", "inService", Set.of(LayerProtocolName.ODU, LayerProtocolName.PHOTONICMEDIA),
+                Set.of(LayerProtocolName.ODU.getName(), LayerProtocolName.PHOTONICMEDIA.getName()),
                 this.tapiTopoUuid);
             this.tapiLinks.put(transiLink.key(), transiLink);
         }
@@ -725,10 +741,10 @@ public class ConvertORTopoToTapiTopo {
             Link omsLink = new LinkBuilder()
                 .setUuid(new Uuid(
                     UUID.nameUUIDFromBytes((String.join(" and ", photonicEntry.getValue(), rdmEntry.getValue()))
-                        .getBytes(Charset.forName("UTF-8")))
+                            .getBytes(Charset.forName("UTF-8")))
                         .toString()))
                 .setName(Map.of(linkName.key(), linkName))
-                .setLayerProtocolName(List.of(LayerProtocolName.PHOTONICMEDIA))
+                .setLayerProtocolName(Set.of(LayerProtocolName.PHOTONICMEDIA))
                 .setNodeEdgePoint(nepMap)
                 .setDirection(ForwardingDirection.BIDIRECTIONAL)
                 .build();