Fix the SIP uuid generation in TAPI topology 30/94730/4
authorGilles Thouenon <gilles.thouenon@orange.com>
Fri, 22 Jan 2021 09:54:41 +0000 (10:54 +0100)
committerGilles Thouenon <gilles.thouenon@orange.com>
Mon, 1 Feb 2021 13:39:18 +0000 (14:39 +0100)
Avoid randomly generation of UUID for the ServiceInterfacePoint in TAPI
topology since it is used in the create-connectivity-service input RPC

JIRA: TRNSPRTPCE-389
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: Ieabeb3e8594af2cd1cc4f56396d07d8ab0b164a5

tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java

index c0b13d5aeba60fbdb436f6ad60949b668b7d0218..f463a8df9d04f1898c3e0b144df007ce7a474d43 100644 (file)
@@ -485,7 +485,7 @@ public class ConvertORTopoToTapiTopo {
             .setLayerProtocolName(nepProtocol)
             .setName(nepNames);
         if (withSip) {
-            onepBldr.setMappedServiceInterfacePoint(createSIP(1));
+            onepBldr.setMappedServiceInterfacePoint(createSIP(this.uuidMap.get(key), 1));
         }
         onepBldr.setSupportedCepLayerProtocolQualifier(createSupportedCepLayerProtocolQualifier(oorTp, nodeProtocol));
         onepBldr.setLinkPortDirection(PortDirection.BIDIRECTIONAL).setLinkPortRole(PortRole.SYMMETRIC)
@@ -552,11 +552,13 @@ public class ConvertORTopoToTapiTopo {
         return nodeRuleGroupMap;
     }
 
-    private Map<MappedServiceInterfacePointKey, MappedServiceInterfacePoint> createSIP(int nb) {
+    private Map<MappedServiceInterfacePointKey, MappedServiceInterfacePoint> createSIP(Uuid nepUuid, int nb) {
         Map<MappedServiceInterfacePointKey, MappedServiceInterfacePoint> msipl = new HashMap<>();
         for (int i = 0; i < nb; i++) {
             MappedServiceInterfacePoint msip = new MappedServiceInterfacePointBuilder()
-                .setServiceInterfacePointUuid(new Uuid(UUID.randomUUID().toString())).build();
+                .setServiceInterfacePointUuid(new Uuid(UUID.nameUUIDFromBytes(nepUuid.getValue()
+                    .getBytes(Charset.forName("UTF-8"))).toString()))
+                .build();
             msipl.put(msip.key(), msip);
         }
         return msipl;