diff options
author | hetengjiao <hetengjiao@chinamobile.com> | 2020-05-13 11:52:38 +0800 |
---|---|---|
committer | HE TENGJIAO <hetengjiao@chinamobile.com> | 2020-05-13 10:57:11 +0000 |
commit | 235d4053ec830eb9dfea3bf3b0113be8ee5643f2 (patch) | |
tree | ef6e64ba8b4fd2260947d1faf32faf02d4e5a09e /bpmn/MSOCommonBPMN/src | |
parent | b164f9cf15af6fdc69ac50fee77e288d2807b7c8 (diff) |
update oof utils to fix bug caused by oof interface change
Issue-ID: SO-2919
Change-Id: Iecdf4a142f090cc0a2555c547bc4b7ba2e165fa3
Signed-off-by: hetengjiao <hetengjiao@chinamobile.com>
Diffstat (limited to 'bpmn/MSOCommonBPMN/src')
-rw-r--r-- | bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy | 39 |
1 files changed, 37 insertions, 2 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 34cbb00735..d307a4e7bc 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 @@ -534,6 +534,7 @@ class OofUtils { public String buildSelectNSTRequest(String requestId, Map<String, Object> profileInfo) { def transactionId = requestId logger.debug( "transactionId is: " + transactionId) + String callbackUrl = "http://0.0.0.0:9000/callback/" ObjectMapper objectMapper = new ObjectMapper() String json = objectMapper.writeValueAsString(profileInfo) StringBuilder response = new StringBuilder() @@ -543,11 +544,45 @@ class OofUtils { " \"transactionId\": \"${transactionId}\",\n" + " \"requestId\": \"${requestId}\",\n" + " \"sourceId\": \"so\",\n" + - " \"timeout\": 600\n" + + " \"timeout\": 600,\n" + + " \"callbackUrl\": \"${callbackUrl}\"\n" + " },\n") - response.append(",\n \"serviceInfo\": \n") + response.append(" \"serviceProfile\": {\n" + + " \"serviceProfileParameters\": ") + response.append(json); + response.append("\n }\n") + response.append("\n}\n") + return response.toString() + } + + public String buildSelectNSIRequest(String requestId, String nstInfo, Map<String, Object> profileInfo){ + + def transactionId = requestId + logger.debug( "transactionId is: " + transactionId) + String callbackUrl = "http://0.0.0.0:9000/callback/" + ObjectMapper objectMapper = new ObjectMapper(); + String json = objectMapper.writeValueAsString(profileInfo); + StringBuilder response = new StringBuilder(); + response.append( + "{\n" + + " \"requestInfo\": {\n" + + " \"transactionId\": \"${transactionId}\",\n" + + " \"requestId\": \"${requestId}\",\n" + + " \"sourceId\": \"so\",\n" + + " \"timeout\": 600,\n" + + " \"callbackUrl\": \"${callbackUrl}\"\n" + + " },\n" + + " \"serviceInfo\": {\n" + + " \"serviceInstanceId\": \"\",\n" + + " \"serviceName\": \"\"\n" + + " },\n" + + " \"NSTInfoList\": [\n") + response.append(nstInfo); + response.append("\n ],\n") + response.append("\n \"serviceProfile\": \n") response.append(json); response.append("\n }\n") return response.toString() } + } |