aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/MSOCommonBPMN
diff options
context:
space:
mode:
authorSeshu Kumar M <seshu.kumar.m@huawei.com>2020-09-26 16:28:07 +0000
committerGerrit Code Review <gerrit@onap.org>2020-09-26 16:28:07 +0000
commita501ef4b6515b6601d5ea84abeb4c019ce9086ce (patch)
treece425f11d4b01d93896ae3304cf5983b63354264 /bpmn/MSOCommonBPMN
parentdc22a628fed70b82d074c509ebd91d51c33e20ec (diff)
parent3e4d7035ff7fc105465840bfaec14da47f64b3aa (diff)
Merge "Update NSMF workflow of allocate"
Diffstat (limited to 'bpmn/MSOCommonBPMN')
-rw-r--r--bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy31
1 files changed, 31 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 44188b462b..bd70ee79b7 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
@@ -23,6 +23,7 @@
package org.onap.so.bpmn.common.scripts
import org.onap.so.beans.nsmf.oof.NsiReqBody
+import org.onap.so.beans.nsmf.oof.NssiReqBody
import org.onap.so.beans.nsmf.oof.RequestInfo
import org.onap.so.beans.nsmf.oof.SubnetCapability
import org.onap.so.beans.nsmf.oof.TemplateInfo
@@ -661,6 +662,7 @@ return json.toString()
List<SubnetCapability> subnetCapabilities, Integer timeOut){
def transactionId = requestId
+ String correlator = requestId
logger.debug( "transactionId is: " + transactionId)
String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
@@ -686,4 +688,33 @@ return json.toString()
return objectMapper.writeValueAsString(nsiReqBody)
}
+
+ public <T> String buildSelectNSSIRequest(String requestId, TemplateInfo nsstInfo, String messageType,
+ T sliceProfile, Integer timeOut){
+
+ def transactionId = requestId
+ String correlator = requestId
+ logger.debug( "transactionId is: " + transactionId)
+
+ String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
+
+ NssiReqBody nssiReqBody = new NssiReqBody()
+
+ RequestInfo requestInfo = new RequestInfo()
+ requestInfo.setRequestId(requestId)
+ requestInfo.setTransactionId(transactionId)
+ requestInfo.setCallbackUrl(callbackUrl)
+ requestInfo.setSourceId("so")
+ requestInfo.setTimeout(timeOut)
+ //requestInfo.setNumSolutions()
+
+ nssiReqBody.setRequestInfo(requestInfo)
+ nssiReqBody.setSliceProfile(sliceProfile)
+ nssiReqBody.setNSSTInfo(nsstInfo)
+
+
+ ObjectMapper objectMapper = new ObjectMapper()
+
+ return objectMapper.writeValueAsString(nssiReqBody)
+ }
}