aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordeepikasatheesh <deepika.s84@wipro.com>2021-08-18 16:38:18 +0000
committerdeepikasatheesh <deepika.s84@wipro.com>2021-08-18 16:54:36 +0000
commit11b71ce0c8520c4f20e00805bfadf2672a537d0e (patch)
tree3589660387732fd8be0fda8861b16e5736f60869
parent9e597da1e74ab81a27879f6100335e6815ff1702 (diff)
Fix S-NSSAI format in E2E Network Slicing
Issue-ID: SO-3670 Signed-off-by: deepikasatheesh <deepika.s84@wipro.com> Change-Id: I93b555800a26068f6ecf4e7e765e4bdefa1565fc
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoCreateCommunicationService.groovy18
-rw-r--r--common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java2
2 files changed, 14 insertions, 6 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
}
}
diff --git a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java
index f06ee49dba..81d64b592d 100644
--- a/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java
+++ b/common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java
@@ -161,7 +161,7 @@ public class SliceProfileAdapter implements Serializable {
BeanUtils.copyProperties(this, perfReqEmbb);
perfReqEmbbs.add(perfReqEmbb);
perfReq.setPerfReqEmbbList(perfReqEmbbs);
- } else if ("ullc".equalsIgnoreCase(sST)) {
+ } else if ("urllc".equalsIgnoreCase(sST)) {
List<PerfReqUrllc> perfReqUrllcs = new ArrayList<>();
PerfReqUrllc perfReqUrllc = new PerfReqUrllc();
BeanUtils.copyProperties(this, perfReqUrllc);