diff options
author | 2021-09-22 13:30:26 +0000 | |
---|---|---|
committer | 2021-09-22 13:30:26 +0000 | |
commit | c8746e6a8074c49c34a243f1aad0fa24201831dd (patch) | |
tree | efc8824256ad38b83789821232c35d97d7dc2221 /bpmn | |
parent | 020ee9da0912f1605172a0092e04a7d8a7f5aac7 (diff) | |
parent | a39f6f33f77331d69652ba7ae787df6a69b3ae5c (diff) |
Merge "Fix S-NSSAI format in E2E Network Slicing" into honolulu
Diffstat (limited to 'bpmn')
-rw-r--r-- | bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateCommunicationService.groovy | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateCommunicationService.groovy b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateCommunicationService.groovy index 9f2ad5b537..e3cbf4c583 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateCommunicationService.groovy +++ b/bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateCommunicationService.groovy @@ -150,15 +150,15 @@ class DoCreateCommunicationService extends AbstractServiceTaskProcessor{ logger.trace("create communication service") String msg String serviceInstanceId = execution.getVariable("serviceInstanceId") + String csServiceType = execution.getVariable("csServiceType") try { //generate S-NSSAI Id and communication service profile - String sNSSAI_id = generateNSSAI(serviceInstanceId) + String sNSSAI_id = generateNSSAI(serviceInstanceId, csServiceType) execution.setVariable("sNSSAI_id", sNSSAI_id) // create communication service String serviceInstanceName = execution.getVariable("serviceInstanceName") String subscriptionServiceType = execution.getVariable("subscriptionServiceType") - String csServiceType = execution.getVariable("csServiceType") String aaiServiceRole = "communication-service" String oStatus = "processing" @@ -198,10 +198,18 @@ class DoCreateCommunicationService extends AbstractServiceTaskProcessor{ logger.trace("exit communication service") } - private static generateNSSAI = { final String instanceId -> + private static generateNSSAI(final String instanceId, String csServiceType) { int h, res + String nssai res = (instanceId == null) ? 0 : (h = instanceId.hashCode()) ^ (h >>> 16) - res = res >>> 1 - return "01-" + Integer.toHexString(res).toUpperCase() + res = res >>> 8 + if ("embb".equalsIgnoreCase(csServiceType)) { + nssai = "01-" + String.format("%06x", res).toUpperCase() + } else if ("urllc".equalsIgnoreCase(csServiceType)) { + nssai = "02-" + String.format("%06x", res).toUpperCase() + } else if ("miot".equalsIgnoreCase(csServiceType)) { + nssai = "03-" + String.format("%06x", res).toUpperCase() + } + return nssai } } |