Replace tpce-topology yang by existing ordmodels
[transportpce.git] / tapi / src / main / java / org / opendaylight / transportpce / tapi / topology / TopologyUtils.java
index b1f5455d0064b12275c41a42f8d378a183bd7fe0..02cba20e2c94c4627b7b5b4ddb359c8994390196 100644 (file)
@@ -17,6 +17,7 @@ import java.util.List;
 import java.util.Map;
 import java.util.NoSuchElementException;
 import java.util.Optional;
+import java.util.Set;
 import java.util.UUID;
 import java.util.concurrent.ExecutionException;
 import java.util.stream.Collectors;
@@ -199,14 +200,14 @@ public final class TopologyUtils {
                 .setName(Map.of(name.key(), name))
                 .setUuid(topoUuid)
                 .setNode(tapiNodeList)
-                .setLayerProtocolName(List.of(LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.ODU,
+                .setLayerProtocolName(Set.of(LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.ODU,
                     LayerProtocolName.DSR))
                 .setLink(tapiLinkList).build();
         }
         return new TopologyBuilder()
             .setName(Map.of(name.key(), name))
             .setUuid(topoUuid)
-            .setLayerProtocolName(List.of(LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.ODU,
+            .setLayerProtocolName(Set.of(LayerProtocolName.PHOTONICMEDIA, LayerProtocolName.ODU,
                 LayerProtocolName.DSR))
             .build();
     }
@@ -221,8 +222,8 @@ public final class TopologyUtils {
         String networkLcp;
         if (tp.augmentation(TerminationPoint1.class).getTpType().equals(OpenroadmTpType.XPONDERCLIENT)) {
             networkLcp = tp.augmentation(
-                    org.opendaylight.yang.gen.v1.http.transportpce.topology.rev220123.TerminationPoint1.class)
-                    .getAssociatedConnectionMapPort();
+                    org.opendaylight.yang.gen.v1.http.org.openroadm.common.network.rev211210.TerminationPoint1.class)
+                    .getAssociatedConnectionMapTp().iterator().next().getValue();
         } else {
             networkLcp = tp.getTpId().getValue();
         }