summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN/src
diff options
context:
space:
mode:
authorChuanyu Chen <chenchuanyu@huawei.com>2020-09-18 09:38:48 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-18 09:38:48 +0000
commit150548c32b0d38d5465f81b8b45923d20bb18f1b (patch)
tree0dad1e5ec8fa49be0ad52241bd4cfbcc77a4d6f9 /bpmn/MSOCommonBPMN/src
parenta65d2595848132a3241889ca3843b2308f9d0862 (diff)
parent177987a9c3bc89a61e211f0fa31781f7abdc3ce8 (diff)
Merge "Update NSMF workflow to for the E2E Network Slicing requirements"
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy36
1 files changed, 36 insertions, 0 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
index 040fc26f23..44188b462b 100644
--- a/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
+++ b/bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
@@ -22,6 +22,11 @@
package org.onap.so.bpmn.common.scripts
+import org.onap.so.beans.nsmf.oof.NsiReqBody
+import org.onap.so.beans.nsmf.oof.RequestInfo
+import org.onap.so.beans.nsmf.oof.SubnetCapability
+import org.onap.so.beans.nsmf.oof.TemplateInfo
+
import static org.onap.so.bpmn.common.scripts.GenericUtils.*
import javax.ws.rs.core.UriBuilder
@@ -650,4 +655,35 @@ json.add("requestInfo", requestInfo)
return json.toString()
}
+
+ public String buildSelectNSIRequest(String requestId, TemplateInfo nstInfo, List<TemplateInfo> nsstInfo,
+ String messageType, Map<String, Object> serviceProfile,
+ List<SubnetCapability> subnetCapabilities, Integer timeOut){
+
+ def transactionId = requestId
+ logger.debug( "transactionId is: " + transactionId)
+
+ String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
+
+ NsiReqBody nsiReqBody = new NsiReqBody()
+
+ RequestInfo requestInfo = new RequestInfo()
+ requestInfo.setRequestId(requestId)
+ requestInfo.setTransactionId(transactionId)
+ requestInfo.setCallbackUrl(callbackUrl)
+ requestInfo.setSourceId("so")
+ requestInfo.setTimeout(timeOut)
+ //requestInfo.setNumSolutions()
+
+ nsiReqBody.setRequestInfo(requestInfo)
+ nsiReqBody.setNSTInfo(nstInfo)
+ nsiReqBody.setServiceProfile(serviceProfile)
+ nsiReqBody.setSubnetCapabilities(subnetCapabilities)
+ nsiReqBody.setNSSTInfo(nsstInfo)
+
+
+ ObjectMapper objectMapper = new ObjectMapper()
+
+ return objectMapper.writeValueAsString(nsiReqBody)
+ }
}