From 39045f4843302526c797b872d6f4dc4405e42050 Mon Sep 17 00:00:00 2001 From: Gilles Thouenon Date: Fri, 22 Jan 2021 10:54:41 +0100 Subject: [PATCH] Fix the SIP uuid generation in TAPI topology 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 Change-Id: Ieabeb3e8594af2cd1cc4f56396d07d8ab0b164a5 (cherry picked from commit f07576835c256e0475043bc4d22fbc2a8c13e0fe) --- .../tapi/topology/ConvertORTopoToTapiTopo.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java index 81bf27e4c..a0d87ae12 100644 --- a/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java +++ b/tapi/src/main/java/org/opendaylight/transportpce/tapi/topology/ConvertORTopoToTapiTopo.java @@ -484,7 +484,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) @@ -551,11 +551,13 @@ public class ConvertORTopoToTapiTopo { return nodeRuleGroupMap; } - private Map createSIP(int nb) { + private Map createSIP(Uuid nepUuid, int nb) { Map 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; -- 2.36.6