Merge "release notes for SO Guilin release"
authorByung-Woo Jun <byung-woo.jun@est.tech>
Tue, 24 Nov 2020 23:46:33 +0000 (23:46 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 24 Nov 2020 23:46:33 +0000 (23:46 +0000)
35 files changed:
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/consts/NssmfAdapterConsts.java
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/enums/ActionType.java
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/BaseNssmfManager.java
adapters/mso-nssmf-adapter/src/main/java/org/onap/so/adapters/nssmf/manager/impl/ExternalNssmfManager.java
adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/NssmfAdapterRestTest.java
adapters/mso-nssmf-adapter/src/test/java/org/onap/so/adapters/nssmf/service/impl/NssmfManagerServiceImplTest.java
adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/openstack/AaiClientPropertiesImpl.java
asdc-controller/src/main/java/org/onap/so/asdc/tenantIsolation/AaiClientPropertiesImpl.java
bpmn/MSOCommonBPMN/src/main/groovy/org/onap/so/bpmn/common/scripts/OofUtils.groovy
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/bpmn/servicedecomposition/tasks/BBInputSetup.java
bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/AAIPropertiesImpl.java
bpmn/so-bpmn-building-blocks/src/main/resources/subprocess/BuildingBlock/CreateVfModuleBB.bpmn
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/AnNssmfutils.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateAccessNSSI.groovy
bpmn/so-bpmn-infrastructure-common/src/main/groovy/org/onap/so/bpmn/infrastructure/scripts/DoAllocateNSIandNSSI.groovy
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasks.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/cnf/CnfAdapterClient.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/AttributeNameValue.java
bpmn/so-bpmn-tasks/src/main/java/org/onap/so/client/adapter/vnf/mapper/VnfAdapterVfModuleObjectMapper.java
bpmn/so-bpmn-tasks/src/test/java/org/onap/so/bpmn/infrastructure/workflow/tasks/WorkflowActionBBTasksTest.java
common/src/main/java/org/onap/so/beans/nsmf/AdditionalProperties.java
common/src/main/java/org/onap/so/beans/nsmf/AllocateTnNssi.java
common/src/main/java/org/onap/so/beans/nsmf/CnSliceProfile.java
common/src/main/java/org/onap/so/beans/nsmf/ConnectionLink.java
common/src/main/java/org/onap/so/beans/nsmf/PnfErrorList.java
common/src/main/java/org/onap/so/beans/nsmf/ResponseHistory.java
common/src/main/java/org/onap/so/beans/nsmf/SliceProfileAdapter.java
common/src/main/java/org/onap/so/beans/nsmf/TransportSliceNetwork.java
common/src/main/java/org/onap/so/beans/nsmf/VnfErrorList.java
common/src/main/java/org/onap/so/client/RestClient.java
common/src/main/java/org/onap/so/client/RestClientSSL.java
common/src/main/java/org/onap/so/client/RestProperties.java
common/src/test/java/org/onap/so/client/RestClientTest.java
mso-api-handlers/mso-api-handler-infra/src/main/java/org/onap/so/apihandlerinfra/tenantisolation/AaiClientPropertiesImpl.java
so-etsi-nfvo/so-etsi-nfvo-ns-lcm/so-etsi-nfvo-ns-lcm-bpmn-flows/src/main/java/org/onap/so/etsi/nfvo/ns/lcm/bpmn/flows/extclients/aai/AaiPropertiesImpl.java

index 84e1eb2..1e3c76c 100644 (file)
@@ -91,8 +91,7 @@ public class NssmfAdapterConsts {
     private final static String INTERNAL_MODIFY_URL = "/onap/so/infra/3gppservices/{apiVersion}/modify";
 
     //
-    private final static String EXTERNAL_QUERY_JOB_STATUS =
-            "/api/rest/provMns/{apiVersion}/NSS/jobs/{jobId}?responseId={responseId}";
+    private final static String EXTERNAL_QUERY_JOB_STATUS = "/api/rest/provMns/{apiVersion}/NSS/jobs/{jobId}";
 
     private final static String INTERNAL_QUERY_SUB_NET_CAPABILITY =
             "/onap/so/infra/3gppservices/{apiVersion}/subnetCapabilityQuery";
index 9df20ba..530cc1b 100644 (file)
@@ -24,6 +24,9 @@ import lombok.Getter;
 
 @Getter
 public enum ActionType {
+    /**
+     * allocate
+     */
     ALLOCATE("allocate"),
 
     DEALLOCATE("deallocate"),
@@ -52,4 +55,13 @@ public enum ActionType {
     ActionType(String type) {
         this.type = type;
     }
+
+    public static ActionType getActionType(String value) {
+        for (ActionType actionType : ActionType.values()) {
+            if (actionType.type.equalsIgnoreCase(value)) {
+                return actionType;
+            }
+        }
+        return null;
+    }
 }
index 2de6e01..fb880a9 100644 (file)
@@ -31,14 +31,19 @@ import org.onap.so.adapters.nssmf.util.RestUtil;
 import org.onap.so.beans.nsmf.*;
 import org.onap.so.db.request.beans.ResourceOperationStatus;
 import org.onap.so.db.request.data.repository.ResourceOperationStatusRepository;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.data.domain.Example;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import static org.onap.so.adapters.nssmf.util.NssmfAdapterUtil.marshal;
 
 public abstract class BaseNssmfManager implements NssmfManager {
 
+    private static final Logger logger = LoggerFactory.getLogger(BaseNssmfManager.class);
+
     protected RestUtil restUtil;
 
     protected ResourceOperationStatusRepository repository;
@@ -152,6 +157,7 @@ public abstract class BaseNssmfManager implements NssmfManager {
         ResourceOperationStatus status =
                 getOperationStatus(serviceInfo.getNsiId(), jobId, serviceInfo.getServiceUuid());
 
+        logger.info("ResourceOperationStatus = {}", status);
         this.restResponse = doQueryJobStatus(status);
 
         afterQueryJobStatus(status);
@@ -165,11 +171,18 @@ public abstract class BaseNssmfManager implements NssmfManager {
 
     private ResourceOperationStatus getOperationStatus(String nsiId, String jobId, String serviceUuid) {
 
+        logger.info("Query operations: nsiId = [{}], jobId = [{}], serviceUuid = [{}]", nsiId, jobId, serviceUuid);
+
         ResourceOperationStatus status = new ResourceOperationStatus(nsiId, jobId, serviceUuid);
 
-        Optional<ResourceOperationStatus> optional = repository.findOne(Example.of(status));
+        List<ResourceOperationStatus> resourceOperationStatuses =
+                repository.findByServiceIdAndOperationId(nsiId, jobId);
 
-        return optional.orElse(null);
+        logger.info("resourceOperationStatuses = {}", resourceOperationStatuses);
+        if (resourceOperationStatuses.size() == 0) {
+            return null;
+        }
+        return resourceOperationStatuses.get(0);
     }
 
     @Override
index 3c5be7e..4b0e98e 100644 (file)
@@ -75,8 +75,9 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager {
 
     @Override
     protected void afterQueryJobStatus(ResourceOperationStatus status) {
+        logger.info("afterQueryJobStatus = " + status);
         if (Integer.parseInt(status.getProgress()) == 100) {
-
+            logger.info("after query finished = " + status);
             ActionType jobOperType = ActionType.valueOf(status.getOperType());
 
             if (ActionType.ALLOCATE.equals(jobOperType)) {
@@ -118,6 +119,8 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager {
         JobStatusResponse jobStatusResponse = unMarshal(restResponse.getResponseContent(), JobStatusResponse.class);
 
         ResponseDescriptor rspDesc = jobStatusResponse.getResponseDescriptor();
+
+        logger.info("status = {}", status);
         rspDesc.setNssiId(status.getResourceInstanceID());
 
         jobStatusResponse.setResponseDescriptor(rspDesc);
@@ -152,7 +155,7 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager {
 
     protected void updateRequestDbJobStatus(ResponseDescriptor rspDesc, ResourceOperationStatus status,
             RestResponse rsp) throws ApplicationException {
-
+        status.setProgress(Integer.toString(rspDesc.getProgress()));
         switch (fromString(rspDesc.getStatus())) {
             case STARTED:
                 updateDbStatus(status, rsp.getStatus(), STARTED, QUERY_JOB_STATUS_SUCCESS);
@@ -168,6 +171,8 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager {
             case ERROR:
                 updateDbStatus(status, rsp.getStatus(), ERROR, QUERY_JOB_STATUS_FAILED);
                 throw new ApplicationException(500, QUERY_JOB_STATUS_FAILED);
+            default:
+                throw new ApplicationException(500, QUERY_JOB_STATUS_FAILED);
         }
     }
 
@@ -227,6 +232,8 @@ public abstract class ExternalNssmfManager extends BaseNssmfManager {
         ResourceOperationStatus status =
                 new ResourceOperationStatus(serviceInfo.getNsiId(), response.getJobId(), serviceInfo.getServiceUuid());
         status.setResourceInstanceID(response.getNssiId());
+        status.setOperType(actionType.toString());
+        status.setProgress("0");
 
         updateDbStatus(status, restResponse.getStatus(), STARTED, NssmfAdapterUtil.getStatusDesc(actionType));
     }
index 2d79544..f150f47 100644 (file)
@@ -77,9 +77,9 @@ public class NssmfAdapterRestTest {
     private final static String ALLOCATE = "{\n" + "  \"esrInfo\" : {\n" + "    \"vendor\" : \"huawei\",\n"
             + "    \"networkType\" : \"cn\"\n" + "  },\n" + "  \"allocateCnNssi\" : {\n"
             + "    \"nssiId\" : \"NSST-C-001-HDBNJ-NSSMF-01-A-ZX\",\n" + "    \"nssiName\" : \"eMBB-001\",\n"
-            + "    \"sliceProfile\" : {\n" + "      \"sNSSAIList\" : [ \"001-100001\" ],\n"
+            + "    \"sliceProfile\" : {\n" + "      \"snssaiList\" : [ \"001-100001\" ],\n"
             + "      \"sliceProfileId\" : \"ab9af40f13f721b5f13539d87484098\",\n"
-            + "      \"pLMNIdList\" : [ \"460-00\", \"460-01\" ],\n" + "      \"perfReq\" : {\n"
+            + "      \"plmnIdList\" : [ \"460-00\", \"460-01\" ],\n" + "      \"perfReq\" : {\n"
             + "        \"perfReqEmbbList\" : [ {\n" + "          \"activityFactor\" : 50\n" + "        } ]\n"
             + "      },\n" + "      \"maxNumberofUEs\" : 200,\n"
             + "      \"coverageAreaTAList\" : [ \"1\", \"2\", \"3\" ],\n" + "      \"latency\" : 6,\n"
index 0d86056..68adf80 100644 (file)
@@ -361,9 +361,10 @@ public class NssmfManagerServiceImplTest {
 
         NssmfAdapterNBIRequest nbiRequest = createNbiRequest();
         nbiRequest.setResponseId("7512eb3feb5249eca5ddd742fedddd39");
-        Optional<ResourceOperationStatus> optional = Optional.of(operationStatus);
+        List<ResourceOperationStatus> optional = new ArrayList<>();
+        optional.add(operationStatus);
 
-        doAnswer(invocation -> optional).when(repository).findOne(any());
+        doAnswer(invocation -> optional).when(repository).findByServiceIdAndOperationId(any(), any());
 
         createCommonMock(200, nssmf);
 
index 12e416f..b7e214f 100644 (file)
@@ -32,6 +32,7 @@ public class AaiClientPropertiesImpl implements AAIProperties {
     private String aaiEndpoint;
     private String auth;
     private String key;
+    private Long readTimeout;
     private static final String SYSTEM_NAME = "MSO";
 
     public AaiClientPropertiesImpl() {
@@ -39,6 +40,7 @@ public class AaiClientPropertiesImpl implements AAIProperties {
         aaiEndpoint = context.getEnvironment().getProperty("aai.endpoint");
         this.auth = context.getEnvironment().getProperty("aai.auth");
         this.key = context.getEnvironment().getProperty("mso.msoKey");
+        this.readTimeout = context.getEnvironment().getProperty("aai.readTimeout", Long.class, new Long(60000));
     }
 
     @Override
@@ -65,4 +67,9 @@ public class AaiClientPropertiesImpl implements AAIProperties {
     public String getKey() {
         return this.key;
     }
+
+    @Override
+    public Long getReadTimeout() {
+        return this.readTimeout;
+    }
 }
index 3ae815d..7b89af0 100644 (file)
@@ -32,6 +32,7 @@ public class AaiClientPropertiesImpl implements AAIProperties {
     private String aaiEndpoint;
     private String auth;
     private String key;
+    private Long readTimeout;
     private static final String SYSTEM_NAME = "MSO";
 
     public AaiClientPropertiesImpl() {
@@ -39,6 +40,7 @@ public class AaiClientPropertiesImpl implements AAIProperties {
         aaiEndpoint = context.getEnvironment().getProperty("mso.aai.endpoint");
         this.auth = context.getEnvironment().getProperty("aai.auth");
         this.key = context.getEnvironment().getProperty("mso.msoKey");
+        this.readTimeout = context.getEnvironment().getProperty("aai.readTimeout", Long.class, new Long(60000));
     }
 
     @Override
@@ -67,4 +69,9 @@ public class AaiClientPropertiesImpl implements AAIProperties {
     public String getKey() {
         return this.key;
     }
+
+    @Override
+    public Long getReadTimeout() {
+        return this.readTimeout;
+    }
 }
index 4eb9eed..c91316e 100644 (file)
@@ -50,7 +50,7 @@ import org.onap.so.db.catalog.beans.HomingInstance
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
 import com.google.gson.JsonObject
-
+import com.google.gson.JsonParser
 import com.fasterxml.jackson.databind.ObjectMapper
 
 class OofUtils {
@@ -596,6 +596,7 @@ String correlator = requestId
 String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
 ObjectMapper objectMapper = new ObjectMapper();
 String profileJson = objectMapper.writeValueAsString(profileInfo);
+JsonParser parser = new JsonParser()
 
 //Prepare requestInfo object
 JsonObject requestInfo = new JsonObject()
@@ -615,9 +616,11 @@ nsstInfo.addProperty("name", name)
 JsonObject json = new JsonObject()
 json.add("requestInfo", requestInfo)
 json.add("NSSTInfo", nsstInfo)
-json.addProperty("sliceProfile", profileJson)
+json.add("sliceProfile", (JsonObject) parser.parse(profileJson))
+
 return json.toString()
 }
+
 /**
 * Method to create NSI/NSSI termination request
 * (OOF response will be synchronous in G-Release)
index 3f78152..2f6713d 100644 (file)
@@ -1622,6 +1622,7 @@ public class BBInputSetup implements JavaDelegate {
                 parameter.setInstanceName(vfModules.getInstanceName());
                 parameter.setInstanceParams(vfModules.getInstanceParams());
                 this.populateVfModule(parameter);
+                gBB.getRequestContext().setIsHelm(parameter.getIsHelm());
             }
         } else if (bbName.contains(NETWORK)) {
             networks = findNetworksByKey(key, resources);
index 692d581..f67af20 100644 (file)
@@ -22,9 +22,9 @@ package org.onap.so.client.restproperties;
 
 import java.net.MalformedURLException;
 import java.net.URL;
-import org.onap.so.bpmn.core.UrnPropertiesReader;
 import org.onap.aaiclient.client.aai.AAIProperties;
 import org.onap.aaiclient.client.aai.AAIVersion;
+import org.onap.so.bpmn.core.UrnPropertiesReader;
 import org.springframework.stereotype.Component;
 
 @Component
@@ -33,6 +33,8 @@ public class AAIPropertiesImpl implements AAIProperties {
     public static final String MSO_MSO_KEY = "mso.msoKey";
     public static final String AAI_AUTH = "aai.auth";
     public static final String AAI_ENDPOINT = "aai.endpoint";
+    public static final String AAI_READ_TIMEOUT = "aai.readTimeout";
+    private UrnPropertiesReader reader;
 
     @Override
     public URL getEndpoint() throws MalformedURLException {
@@ -58,4 +60,10 @@ public class AAIPropertiesImpl implements AAIProperties {
     public String getKey() {
         return UrnPropertiesReader.getVariable(MSO_MSO_KEY);
     }
+
+    @Override
+    public Long getReadTimeout() {
+        return Long.valueOf(reader.getVariable(AAI_READ_TIMEOUT, "60000"));
+    }
+
 }
index 9e2c0db..a32e9e8 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="3.7.0">
+<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="Definitions_1" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="4.1.1">
   <bpmn:process id="CreateVfModuleBB" name="CreateVfModuleBB" isExecutable="true">
     <bpmn:startEvent id="CreateVfModuleBB_Start">
       <bpmn:outgoing>SequenceFlow_1xr6chl</bpmn:outgoing>
@@ -46,7 +46,8 @@
     <bpmn:sequenceFlow id="SequenceFlow_0rds4rj" sourceRef="UpdateVfModuleHeatStackId" targetRef="UpdateVfModuleStatus" />
     <bpmn:sequenceFlow id="SequenceFlow_1vbwdaw" sourceRef="UpdateVfModuleStatus" targetRef="CreateVfModuleBB_End" />
     <bpmn:serviceTask id="CreateNetworkPolicies" name="AAI Create (network policies)" camunda:expression="${AAICreateTasks.createNetworkPolicies(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
-      <bpmn:incoming>SequenceFlow_1yn8o6d</bpmn:incoming>
+      <bpmn:incoming>Flow_10aq7a8</bpmn:incoming>
+      <bpmn:incoming>Flow_1il4743</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_0xqhep5</bpmn:outgoing>
     </bpmn:serviceTask>
     <bpmn:sequenceFlow id="SequenceFlow_0xqhep5" sourceRef="CreateNetworkPolicies" targetRef="UpdateVnfIpv4OamAddress" />
     </bpmn:serviceTask>
     <bpmn:sequenceFlow id="SequenceFlow_15do1tu" sourceRef="UpdateVfModuleContrailServiceInstanceFqdn" targetRef="UpdateVfModuleHeatStackId" />
     <bpmn:serviceTask id="ServiceTask_01zrt6x" name="&#10;Create&#10;Cloud&#10;Variable&#10;" camunda:expression="${CreateVFModule.createInventoryVariable(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
-      <bpmn:incoming>SequenceFlow_1mg8eym</bpmn:incoming>
       <bpmn:incoming>SequenceFlow_0uetprw</bpmn:incoming>
       <bpmn:outgoing>SequenceFlow_1io8r33</bpmn:outgoing>
     </bpmn:serviceTask>
     <bpmn:sequenceFlow id="SequenceFlow_1io8r33" sourceRef="ServiceTask_01zrt6x" targetRef="ServiceTask_00d84m7" />
     <bpmn:serviceTask id="ServiceTask_00d84m7" name="&#10;AAI&#10;Create&#10;(inventory)&#10;" camunda:type="external" camunda:topic="InventoryCreate">
       <bpmn:incoming>SequenceFlow_1io8r33</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_1yn8o6d</bpmn:outgoing>
+      <bpmn:outgoing>Flow_10aq7a8</bpmn:outgoing>
     </bpmn:serviceTask>
-    <bpmn:sequenceFlow id="SequenceFlow_1yn8o6d" sourceRef="ServiceTask_00d84m7" targetRef="CreateNetworkPolicies" />
     <bpmn:exclusiveGateway id="CheckIfIsHelm" name="Check If Is Helm">
       <bpmn:incoming>SequenceFlow_1ig2ix4</bpmn:incoming>
       <bpmn:outgoing>YesHelm</bpmn:outgoing>
     </bpmn:exclusiveGateway>
     <bpmn:serviceTask id="CnfAdapter" name="Cnf Adapter" camunda:expression="${CnfAdapterCreateTasks.createInstance(InjectExecution.execute(execution, execution.getVariable(&#34;gBuildingBlockExecution&#34;)))}">
       <bpmn:incoming>YesHelm</bpmn:incoming>
-      <bpmn:outgoing>SequenceFlow_1mg8eym</bpmn:outgoing>
+      <bpmn:outgoing>Flow_1il4743</bpmn:outgoing>
     </bpmn:serviceTask>
     <bpmn:sequenceFlow id="YesHelm" name="Yes Helm" sourceRef="CheckIfIsHelm" targetRef="CnfAdapter">
       <bpmn:conditionExpression xsi:type="bpmn:tFormalExpression">${execution.getVariable("isHelm")}</bpmn:conditionExpression>
     </bpmn:sequenceFlow>
-    <bpmn:sequenceFlow id="SequenceFlow_1mg8eym" sourceRef="CnfAdapter" targetRef="ServiceTask_01zrt6x" />
     <bpmn:sequenceFlow id="SequenceFlow_1ig2ix4" sourceRef="QueryVfModule" targetRef="CheckIfIsHelm" />
     <bpmn:sequenceFlow id="NoHelm" name="No Helm" sourceRef="CheckIfIsHelm" targetRef="CreateVfModule" />
     <bpmn:sequenceFlow id="SequenceFlow_0dehck5" sourceRef="CreateVfModule" targetRef="VnfAdapter" />
       <bpmn:sequenceFlow id="Flow_1sqy91r" sourceRef="Event_1pengt4" targetRef="Activity_1p8hxyt" />
       <bpmn:sequenceFlow id="Flow_03q6ty9" sourceRef="Activity_1p8hxyt" targetRef="Event_108oetk" />
     </bpmn:subProcess>
+    <bpmn:sequenceFlow id="Flow_10aq7a8" sourceRef="ServiceTask_00d84m7" targetRef="CreateNetworkPolicies" />
+    <bpmn:sequenceFlow id="Flow_1il4743" sourceRef="CnfAdapter" targetRef="CreateNetworkPolicies" />
   </bpmn:process>
   <bpmn:error id="Error_0t7oivz" name="AAIInventoryFailure" errorCode="AAIInventoryFailure" />
   <bpmndi:BPMNDiagram id="BPMNDiagram_1">
     <bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="CreateVfModuleBB">
-      <bpmndi:BPMNShape id="StartEvent_0kxwniy_di" bpmnElement="CreateVfModuleBB_Start">
-        <dc:Bounds x="156" y="88" width="36" height="36" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="77" y="124" width="0" height="0" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_13t22km_di" bpmnElement="QueryVfModule">
-        <dc:Bounds x="513" y="66" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1xr6chl_di" bpmnElement="SequenceFlow_1xr6chl">
-        <di:waypoint x="192" y="106" />
-        <di:waypoint x="313" y="106" />
+      <bpmndi:BPMNEdge id="SequenceFlow_0uetprw_di" bpmnElement="SequenceFlow_0uetprw">
+        <di:waypoint x="1009" y="146" />
+        <di:waypoint x="1009" y="326" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="156" y="91" width="0" height="0" />
+          <dc:Bounds x="1024" y="228" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="EndEvent_0qdq7wj_di" bpmnElement="CreateVfModuleBB_End">
-        <dc:Bounds x="1300" y="450" width="36" height="36" />
+      <bpmndi:BPMNEdge id="SequenceFlow_0dehck5_di" bpmnElement="SequenceFlow_0dehck5">
+        <di:waypoint x="894" y="106" />
+        <di:waypoint x="959" y="106" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1176" y="446" width="90" height="0" />
+          <dc:Bounds x="926.5" y="85" width="0" height="12" />
         </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_1dgenhy_di" bpmnElement="CreateVfModule">
-        <dc:Bounds x="794" y="66" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1s4rpyp_di" bpmnElement="SequenceFlow_1s4rpyp">
-        <di:waypoint x="413" y="106" />
-        <di:waypoint x="513" y="106" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="SequenceFlow_1g7zahc_di" bpmnElement="NoHelm">
+        <di:waypoint x="721" y="106" />
+        <di:waypoint x="794" y="106" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="321" y="91" width="90" height="0" />
+          <dc:Bounds x="736" y="85" width="44" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_1frb5h2_di" bpmnElement="QueryVnf">
-        <dc:Bounds x="313" y="66" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="CallActivity_1i1pfzb_di" bpmnElement="VnfAdapter">
-        <dc:Bounds x="959" y="66" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_0fpfn71_di" bpmnElement="UpdateVfModuleStatus">
-        <dc:Bounds x="1124" y="428" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_04k1b85_di" bpmnElement="UpdateVfModuleHeatStackId">
-        <dc:Bounds x="959" y="428" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0rds4rj_di" bpmnElement="SequenceFlow_0rds4rj">
-        <di:waypoint x="1059" y="468" />
-        <di:waypoint x="1124" y="468" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1ig2ix4_di" bpmnElement="SequenceFlow_1ig2ix4">
+        <di:waypoint x="613" y="106" />
+        <di:waypoint x="671" y="106" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="950" y="409" width="90" height="0" />
+          <dc:Bounds x="652" y="85" width="0" height="12" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1vbwdaw_di" bpmnElement="SequenceFlow_1vbwdaw">
-        <di:waypoint x="1224" y="468" />
-        <di:waypoint x="1265" y="468" />
-        <di:waypoint x="1265" y="468" />
-        <di:waypoint x="1300" y="468" />
+      <bpmndi:BPMNEdge id="SequenceFlow_0q1janp_di" bpmnElement="YesHelm">
+        <di:waypoint x="696" y="131" />
+        <di:waypoint x="696" y="210" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1138" y="424" width="90" height="0" />
+          <dc:Bounds x="688" y="177" width="47" height="14" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_1v8zx4s_di" bpmnElement="CreateNetworkPolicies">
-        <dc:Bounds x="324" y="428" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0xqhep5_di" bpmnElement="SequenceFlow_0xqhep5">
-        <di:waypoint x="424" y="468" />
-        <di:waypoint x="477" y="468" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1io8r33_di" bpmnElement="SequenceFlow_1io8r33">
+        <di:waypoint x="959" y="366" />
+        <di:waypoint x="746" y="366" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="309" y="409" width="90" height="0" />
+          <dc:Bounds x="569" y="297" width="90" height="20" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_015ayw5_di" bpmnElement="UpdateVnfIpv4OamAddress">
-        <dc:Bounds x="477" y="428" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1yo6mvv_di" bpmnElement="SequenceFlow_1yo6mvv">
-        <di:waypoint x="577" y="468" />
-        <di:waypoint x="646" y="468" />
+      <bpmndi:BPMNEdge id="SequenceFlow_15do1tu_di" bpmnElement="SequenceFlow_15do1tu">
+        <di:waypoint x="894" y="468" />
+        <di:waypoint x="959" y="468" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="470" y="409" width="90" height="0" />
+          <dc:Bounds x="785" y="399" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_0mlfsc9_di" bpmnElement="UpdateVnfManagementV6Address">
-        <dc:Bounds x="646" y="428" width="100" height="80" />
-      </bpmndi:BPMNShape>
       <bpmndi:BPMNEdge id="SequenceFlow_1i03uy2_di" bpmnElement="SequenceFlow_1i03uy2">
         <di:waypoint x="746" y="468" />
         <di:waypoint x="794" y="468" />
           <dc:Bounds x="628" y="409" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_0wctnhw_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn">
-        <dc:Bounds x="794" y="428" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_15do1tu_di" bpmnElement="SequenceFlow_15do1tu">
-        <di:waypoint x="894" y="468" />
-        <di:waypoint x="959" y="468" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1yo6mvv_di" bpmnElement="SequenceFlow_1yo6mvv">
+        <di:waypoint x="577" y="468" />
+        <di:waypoint x="646" y="468" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="785" y="399" width="90" height="0" />
+          <dc:Bounds x="470" y="409" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_01zrt6x_di" bpmnElement="ServiceTask_01zrt6x">
-        <dc:Bounds x="665" y="326" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1io8r33_di" bpmnElement="SequenceFlow_1io8r33">
-        <di:waypoint x="665" y="366" />
-        <di:waypoint x="563" y="366" />
+      <bpmndi:BPMNEdge id="SequenceFlow_0xqhep5_di" bpmnElement="SequenceFlow_0xqhep5">
+        <di:waypoint x="424" y="468" />
+        <di:waypoint x="477" y="468" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="569" y="297" width="90" height="20" />
+          <dc:Bounds x="309" y="409" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ServiceTask_00d84m7_di" bpmnElement="ServiceTask_00d84m7">
-        <dc:Bounds x="463" y="326" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_1yn8o6d_di" bpmnElement="SequenceFlow_1yn8o6d">
-        <di:waypoint x="463" y="366" />
-        <di:waypoint x="255" y="366" />
-        <di:waypoint x="255" y="463" />
-        <di:waypoint x="324" y="463" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1vbwdaw_di" bpmnElement="SequenceFlow_1vbwdaw">
+        <di:waypoint x="1224" y="468" />
+        <di:waypoint x="1265" y="468" />
+        <di:waypoint x="1265" y="468" />
+        <di:waypoint x="1300" y="468" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="225" y="361" width="90" height="20" />
+          <dc:Bounds x="1138" y="424" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNShape id="ExclusiveGateway_1g3vemz_di" bpmnElement="CheckIfIsHelm" isMarkerVisible="true">
-        <dc:Bounds x="690.2114427860697" y="81.35572139303483" width="50" height="50" />
-        <bpmndi:BPMNLabel>
-          <dc:Bounds x="673" y="48" width="84" height="12" />
-        </bpmndi:BPMNLabel>
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNShape id="ServiceTask_0tag50w_di" bpmnElement="CnfAdapter">
-        <dc:Bounds x="665" y="166" width="100" height="80" />
-      </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="SequenceFlow_0q1janp_di" bpmnElement="YesHelm">
-        <di:waypoint x="715" y="131" />
-        <di:waypoint x="715" y="166" />
+      <bpmndi:BPMNEdge id="SequenceFlow_0rds4rj_di" bpmnElement="SequenceFlow_0rds4rj">
+        <di:waypoint x="1059" y="468" />
+        <di:waypoint x="1124" y="468" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="730" y="136" width="0" height="12" />
+          <dc:Bounds x="950" y="409" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1mg8eym_di" bpmnElement="SequenceFlow_1mg8eym">
-        <di:waypoint x="715" y="246" />
-        <di:waypoint x="715" y="326" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1s4rpyp_di" bpmnElement="SequenceFlow_1s4rpyp">
+        <di:waypoint x="413" y="106" />
+        <di:waypoint x="513" y="106" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="846" y="291.5" width="0" height="12" />
+          <dc:Bounds x="321" y="91" width="90" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1ig2ix4_di" bpmnElement="SequenceFlow_1ig2ix4">
-        <di:waypoint x="613" y="106" />
-        <di:waypoint x="691" y="106" />
+      <bpmndi:BPMNEdge id="SequenceFlow_1xr6chl_di" bpmnElement="SequenceFlow_1xr6chl">
+        <di:waypoint x="192" y="106" />
+        <di:waypoint x="313" y="106" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="652" y="85" width="0" height="12" />
+          <dc:Bounds x="156" y="91" width="0" height="0" />
         </bpmndi:BPMNLabel>
       </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_1g7zahc_di" bpmnElement="NoHelm">
-        <di:waypoint x="740" y="106" />
-        <di:waypoint x="794" y="106" />
+      <bpmndi:BPMNEdge id="Flow_10aq7a8_di" bpmnElement="Flow_10aq7a8">
+        <di:waypoint x="646" y="366" />
+        <di:waypoint x="374" y="366" />
+        <di:waypoint x="374" y="428" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1il4743_di" bpmnElement="Flow_1il4743">
+        <di:waypoint x="646" y="250" />
+        <di:waypoint x="200" y="250" />
+        <di:waypoint x="200" y="468" />
+        <di:waypoint x="324" y="468" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNShape id="StartEvent_0kxwniy_di" bpmnElement="CreateVfModuleBB_Start">
+        <dc:Bounds x="156" y="88" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="767" y="85" width="0" height="12" />
+          <dc:Bounds x="77" y="124" width="0" height="0" />
         </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0dehck5_di" bpmnElement="SequenceFlow_0dehck5">
-        <di:waypoint x="894" y="106" />
-        <di:waypoint x="959" y="106" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_13t22km_di" bpmnElement="QueryVfModule">
+        <dc:Bounds x="513" y="66" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="EndEvent_0qdq7wj_di" bpmnElement="CreateVfModuleBB_End">
+        <dc:Bounds x="1300" y="450" width="36" height="36" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="926.5" y="85" width="0" height="12" />
+          <dc:Bounds x="1176" y="446" width="90" height="0" />
         </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="SequenceFlow_0uetprw_di" bpmnElement="SequenceFlow_0uetprw">
-        <di:waypoint x="1009" y="146" />
-        <di:waypoint x="1009" y="366" />
-        <di:waypoint x="765" y="366" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1dgenhy_di" bpmnElement="CreateVfModule">
+        <dc:Bounds x="794" y="66" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1frb5h2_di" bpmnElement="QueryVnf">
+        <dc:Bounds x="313" y="66" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="CallActivity_1i1pfzb_di" bpmnElement="VnfAdapter">
+        <dc:Bounds x="959" y="66" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_0fpfn71_di" bpmnElement="UpdateVfModuleStatus">
+        <dc:Bounds x="1124" y="428" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_04k1b85_di" bpmnElement="UpdateVfModuleHeatStackId">
+        <dc:Bounds x="959" y="428" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_1v8zx4s_di" bpmnElement="CreateNetworkPolicies">
+        <dc:Bounds x="324" y="428" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_015ayw5_di" bpmnElement="UpdateVnfIpv4OamAddress">
+        <dc:Bounds x="477" y="428" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_0mlfsc9_di" bpmnElement="UpdateVnfManagementV6Address">
+        <dc:Bounds x="646" y="428" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_0wctnhw_di" bpmnElement="UpdateVfModuleContrailServiceInstanceFqdn">
+        <dc:Bounds x="794" y="428" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_01zrt6x_di" bpmnElement="ServiceTask_01zrt6x">
+        <dc:Bounds x="959" y="326" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_00d84m7_di" bpmnElement="ServiceTask_00d84m7">
+        <dc:Bounds x="646" y="326" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ServiceTask_0tag50w_di" bpmnElement="CnfAdapter">
+        <dc:Bounds x="646" y="210" width="100" height="80" />
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="ExclusiveGateway_1g3vemz_di" bpmnElement="CheckIfIsHelm" isMarkerVisible="true">
+        <dc:Bounds x="671" y="81" width="50" height="50" />
         <bpmndi:BPMNLabel>
-          <dc:Bounds x="1024" y="228" width="0" height="12" />
+          <dc:Bounds x="655" y="48" width="82" height="14" />
         </bpmndi:BPMNLabel>
-      </bpmndi:BPMNEdge>
+      </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="Activity_10eqhmz_di" bpmnElement="Activity_10eqhmz" isExpanded="true">
         <dc:Bounds x="240" y="590" width="340" height="180" />
       </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge id="Flow_03q6ty9_di" bpmnElement="Flow_03q6ty9">
+        <di:waypoint x="460" y="680" />
+        <di:waypoint x="512" y="680" />
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge id="Flow_1sqy91r_di" bpmnElement="Flow_1sqy91r">
+        <di:waypoint x="316" y="680" />
+        <di:waypoint x="360" y="680" />
+      </bpmndi:BPMNEdge>
       <bpmndi:BPMNShape id="Event_108oetk_di" bpmnElement="Event_108oetk">
         <dc:Bounds x="512" y="662" width="36" height="36" />
       </bpmndi:BPMNShape>
       <bpmndi:BPMNShape id="Activity_1p8hxyt_di" bpmnElement="Activity_1p8hxyt">
         <dc:Bounds x="360" y="640" width="100" height="80" />
       </bpmndi:BPMNShape>
-      <bpmndi:BPMNEdge id="Flow_1sqy91r_di" bpmnElement="Flow_1sqy91r">
-        <di:waypoint x="316" y="680" />
-        <di:waypoint x="360" y="680" />
-      </bpmndi:BPMNEdge>
-      <bpmndi:BPMNEdge id="Flow_03q6ty9_di" bpmnElement="Flow_03q6ty9">
-        <di:waypoint x="460" y="680" />
-        <di:waypoint x="512" y="680" />
-      </bpmndi:BPMNEdge>
     </bpmndi:BPMNPlane>
   </bpmndi:BPMNDiagram>
 </bpmn:definitions>
index 4108cce..1d8de35 100644 (file)
@@ -37,6 +37,7 @@ import java.sql.Timestamp
 import java.util.List
 import static org.apache.commons.lang3.StringUtils.isBlank
 import com.google.gson.JsonObject
+import com.google.gson.JsonParser
 import com.fasterxml.jackson.databind.ObjectMapper
 import org.onap.aaiclient.client.aai.AAIObjectType
 import org.onap.aaiclient.client.aai.AAIResourcesClient
@@ -48,7 +49,6 @@ import org.onap.aaiclient.client.generated.fluentbuilders.AAIFluentTypeBuilder.T
 import javax.ws.rs.NotFoundException
 import org.onap.so.beans.nsmf.AllocateTnNssi
 import org.onap.so.beans.nsmf.DeAllocateNssi
-import org.onap.so.beans.nsmf.EsrInfo
 import org.onap.so.beans.nsmf.ServiceInfo
 import org.onap.so.bpmn.core.UrnPropertiesReader
 import org.onap.aai.domain.yang.ServiceInstance
@@ -65,12 +65,11 @@ class AnNssmfUtils {
        JsonUtils jsonUtil = new JsonUtils()
        public String buildSelectRANNSSIRequest(String requestId, String messageType, String UUID,String invariantUUID,
                String name, Map<String, Object> profileInfo, List<String> nsstInfoList, JsonArray capabilitiesList, Boolean preferReuse){
-
+       JsonParser parser = new JsonParser()
        def transactionId = requestId
        logger.debug( "transactionId is: " + transactionId)
        String correlator = requestId
        String callbackUrl = UrnPropertiesReader.getVariable("mso.adapters.oof.callback.endpoint") + "/" + messageType + "/" + correlator
-       ObjectMapper objectMapper = new ObjectMapper();
        String profileJson = objectMapper.writeValueAsString(profileInfo);
        String nsstInfoListString = objectMapper.writeValueAsString(nsstInfoList);
        //Prepare requestInfo object
@@ -91,8 +90,8 @@ class AnNssmfUtils {
        JsonObject json = new JsonObject()
        json.add("requestInfo", requestInfo)
        json.add("NSTInfo", ranNsstInfo)
-       json.addProperty("serviceProfile", profileJson)
-       json.addProperty("NSSTInfo", nsstInfoListString)
+       json.add("serviceProfile", (JsonObject) parser.parse(profileJson))
+       //json.add("NSSTInfo", (JsonArray) parser.parse(nsstInfoListString))
        json.add("subnetCapabilities", capabilitiesList)
        json.addProperty("preferReuse", preferReuse)
 
@@ -100,29 +99,33 @@ class AnNssmfUtils {
 }
 
 public String buildCreateTNNSSMFSubnetCapabilityRequest() {
-       EsrInfo esrInfo = new EsrInfo()
-       esrInfo.setNetworkType("TN")
-       esrInfo.setVendor("ONAP")
+       JsonObject esrInfo = new JsonObject()
+       esrInfo.addProperty("networkType", "tn")
+       esrInfo.addProperty("vendor", "ONAP_internal")
 
        JsonArray subnetTypes = new JsonArray()
        subnetTypes.add("TN_FH")
        subnetTypes.add("TN_MH")
        JsonObject response = new JsonObject()
-       response.add("subnetCapabilityQuery", subnetTypes)
-       response.addProperty("esrInfo", objectMapper.writeValueAsString(esrInfo))
+       JsonObject subnetTypesObj = new JsonObject()
+       subnetTypesObj.add("subnetTypes", subnetTypes)
+       response.add("subnetCapabilityQuery", subnetTypesObj)
+       response.add("esrInfo", esrInfo)
        return response.toString()
 }
 
 public String buildCreateANNFNSSMFSubnetCapabilityRequest() {
-       EsrInfo esrInfo = new EsrInfo()
-       esrInfo.setNetworkType("AN")
-       esrInfo.setVendor("ONAP")
+       JsonObject esrInfo = new JsonObject()
+       esrInfo.addProperty("networkType", "an")
+       esrInfo.addProperty("vendor", "ONAP_internal")
 
        JsonArray subnetTypes = new JsonArray()
        subnetTypes.add("AN_NF")
        JsonObject response = new JsonObject()
-       response.add("subnetCapabilityQuery", subnetTypes)
-       response.addProperty("esrInfo", objectMapper.writeValueAsString(esrInfo))
+       JsonObject subnetTypesObj = new JsonObject()
+       subnetTypesObj.add("subnetTypes", subnetTypes)
+       response.add("subnetCapabilityQuery", subnetTypesObj)
+       response.add("esrInfo", esrInfo)
        return response.toString()
 }
 public void createDomainWiseSliceProfiles(List<String> ranConstituentSliceProfiles, DelegateExecution execution) {
@@ -190,16 +193,19 @@ public void createSliceProfilesInAai(DelegateExecution execution) {
        ANNF_sliceProfileInstance.setServiceType(serviceType)
        String serviceStatus = "deactivated"
        ANNF_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
-       String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList")
+       String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "pLMNIdList")
        ANNF_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
        String serviceRole = "slice-profile-instance"
        ANNF_sliceProfileInstance.setServiceRole(serviceRole)
-       List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+        ArrayList<String> snssaiList = execution.getVariable("snssaiList")
        String snssai = snssaiList.get(0)
        ANNF_sliceProfileInstance.setEnvironmentContext(snssai)
        ANNF_sliceProfileInstance.setWorkloadContext("AN-NF")    
        ANNF_sliceProfileInstance.setSliceProfiles(ANNF_SliceProfiles)
-       logger.debug("completed ANNF sliceprofileinstance build "+ ANNF_sliceProfileInstance.toString())
+       String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "resourceSharingLevel")
+       ANNF_sliceProfileInstance.setServiceFunction(serviceFunctionAnnf)
+       logger.debug("completed ANNF sliceprofileinstance build : "+ ANNF_sliceProfileInstance.toString())
+       
        //TNFH slice profile instance creation
        TNFH_sliceProfileInstance.setServiceInstanceId(TNFH_sliceProfileInstanceId)
        sliceInstanceName = "sliceprofile_"+TNFH_sliceProfileId
@@ -207,13 +213,16 @@ public void createSliceProfilesInAai(DelegateExecution execution) {
        serviceType = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "sST")
        TNFH_sliceProfileInstance.setServiceType(serviceType)
        TNFH_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
-       serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "plmnIdList")
+       serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "pLMNIdList")
        TNFH_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
        TNFH_sliceProfileInstance.setServiceRole(serviceRole)
        TNFH_sliceProfileInstance.setEnvironmentContext(snssai)
        TNFH_sliceProfileInstance.setWorkloadContext("TN-FH")
        TNFH_sliceProfileInstance.setSliceProfiles(TNFH_SliceProfiles)
-       logger.debug("completed TNFH sliceprofileinstance build "+TNFH_sliceProfileInstance)
+       String serviceFunctionTnFH = jsonUtil.getJsonValue(execution.getVariable("tnFhSliceProfile"), "resourceSharingLevel")
+       TNFH_sliceProfileInstance.setServiceFunction(serviceFunctionTnFH)
+       logger.debug("completed TNFH sliceprofileinstance build : "+TNFH_sliceProfileInstance)
+       
        //TNMH slice profile instance creation
        TNMH_sliceProfileInstance.setServiceInstanceId(TNMH_sliceProfileInstanceId)
        sliceInstanceName = "sliceprofile_"+TNMH_sliceProfileId
@@ -221,13 +230,16 @@ public void createSliceProfilesInAai(DelegateExecution execution) {
        serviceType = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "sST")
        TNMH_sliceProfileInstance.setServiceType(serviceType)
        TNMH_sliceProfileInstance.setOrchestrationStatus(serviceStatus)
-       serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "plmnIdList")
+       serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "pLMNIdList")
        TNMH_sliceProfileInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
        TNMH_sliceProfileInstance.setServiceRole(serviceRole)
        TNMH_sliceProfileInstance.setEnvironmentContext(snssai)
        TNMH_sliceProfileInstance.setWorkloadContext("TN-MH")
        TNMH_sliceProfileInstance.setSliceProfiles(TNMH_SliceProfiles)
-       logger.debug("completed TNMH sliceprofileinstance build "+TNMH_sliceProfileInstance)
+       String serviceFunctionTnMH = jsonUtil.getJsonValue(execution.getVariable("tnMhSliceProfile"), "resourceSharingLevel")
+       TNMH_sliceProfileInstance.setServiceFunction(serviceFunctionTnMH)
+       logger.debug("completed TNMH sliceprofileinstance build : "+TNMH_sliceProfileInstance)
+       
        String msg = ""
        try {
 
@@ -261,12 +273,10 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
                        result.setJitter(profile.get("jitter"))
                        result.setLatency(profile.get("latency"))
                        result.setResourceSharingLevel(profile.get("resourceSharingLevel"))
-                       result.setSNssai(profile.get("sNSSAI"))
                        result.setUeMobilityLevel(profile.get("uEMobilityLevel"))
                        result.setMaxNumberOfUEs(profile.get("maxNumberofUEs"))
                        result.setActivityFactor(profile.get("activityFactor"))
                        result.setCoverageAreaTAList(profile.get("coverageAreaTAList"))
-                       result.setCsAvailability(profile.get("cSAvailabilityTarget"))
                        result.setExpDataRateDL(profile.get("expDataRateDL"))
                        result.setExpDataRateUL(profile.get("expDataRateUL"))
                        result.setSurvivalTime(profile.get("survivalTime"))
@@ -280,7 +290,6 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
                        result.setJitter(profile.get("jitter"))
                        result.setLatency(profile.get("latency"))
                        result.setResourceSharingLevel(profile.get("resourceSharingLevel"))
-                       result.setSNssai(profile.get("sNSSAI"))
                        result.setProfileId(execution.getVariable("TNFH_sliceProfileId"))
                        break
                case "TN-MH":
@@ -288,7 +297,6 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
                        result.setJitter(profile.get("jitter"))
                        result.setLatency(profile.get("latency"))
                        result.setResourceSharingLevel(profile.get("resourceSharingLevel"))
-                       result.setSNssai(profile.get("sNSSAI"))
                        result.setProfileId(execution.getVariable("TNMH_sliceProfileId"))
                        break
                default:
@@ -307,13 +315,13 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
         String msg
                AAIResourcesClient client = new AAIResourcesClient()
         try {
-            AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("subscriptionServiceType")).serviceInstance(instanceId).relationshipAPI())
+            AAIResourceUri uri = AAIUriFactory.createResourceUri(AAIFluentTypeBuilder.business().customer(execution.getVariable("globalSubscriberId")).serviceSubscription(execution.getVariable("subscriptionServiceType")).serviceInstance(instanceId)).relationshipAPI()
             client.create(uri, relationship)
 
         } catch (BpmnError e) {
             throw e
         } catch (Exception ex) {
-            msg = "Exception in CreateCommunicationService.createRelationShipInAAI. " + ex.getMessage()
+            msg = "Exception in AN NSSMF Utils : CreateRelationShipInAAI. " + ex.getMessage()
             logger.info(msg)
             exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
         }
@@ -333,10 +341,9 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
        }
        
        public String buildCreateNSSMFRequest(DelegateExecution execution, String domainType, String action) {
-               EsrInfo esrInfo = new EsrInfo()
-               esrInfo.setNetworkType("TN")
-               esrInfo.setVendor("ONAP")
-               String esrInfoString = objectMapper.writeValueAsString(esrInfo)
+               JsonObject esrInfo = new JsonObject()
+           esrInfo.addProperty("networkType", "tn")
+           esrInfo.addProperty("vendor", "ONAP_internal")
                JsonObject response = new JsonObject()
                JsonObject allocateTnNssi = new JsonObject()
                JsonObject serviceInfo = new JsonObject()
@@ -404,7 +411,7 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
                serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
                serviceInfo.addProperty("globalSubscriberId", execution.getVariable("globalSubscriberId"))
                serviceInfo.addProperty("subscriptionServiceType", execution.getVariable("subscriptionServiceType"))
-               response.addProperty("esrInfo", esrInfoString)
+               response.add("esrInfo", esrInfo)
                response.add("serviceInfo", serviceInfo)
                response.add("allocateTnNssi", allocateTnNssi)
                return response.toString()
@@ -429,9 +436,9 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
                        deAllocateNssi.addProperty("sliceProfileId", execution.getVariable("TNMH_sliceProfileInstanceId"))
                }
                
-               EsrInfo esrInfo = new EsrInfo()
-               esrInfo.setVendor("ONAP")
-               esrInfo.setNetworkType("TN")
+               JsonObject esrInfo = new JsonObject()
+           esrInfo.addProperty("networkType", "tn")
+           esrInfo.addProperty("vendor", "ONAP_internal")
           
                JsonObject serviceInfo = new JsonObject()
                serviceInfo.addProperty("serviceInvariantUuid", null)
@@ -441,9 +448,9 @@ private SliceProfile createSliceProfile(String domainType, DelegateExecution exe
           
                JsonObject json = new JsonObject()
                json.add("deAllocateNssi", deAllocateNssi)
-               json.addProperty("esrInfo", objectMapper.writeValueAsString(esrInfo))
+               json.add("esrInfo", esrInfo)
                json.add("serviceInfo", serviceInfo)
                return json.toString()
           
        }
-}
\ No newline at end of file
+}
index fc14da3..e1719aa 100644 (file)
@@ -31,17 +31,16 @@ import org.onap.so.bpmn.core.json.JsonUtils
 import org.onap.so.db.request.beans.ResourceOperationStatus
 import org.slf4j.Logger
 import org.slf4j.LoggerFactory
-import java.sql.Timestamp
 import java.util.List
 import static org.apache.commons.lang3.StringUtils.isBlank
 import com.google.gson.JsonObject
 import com.fasterxml.jackson.databind.ObjectMapper
 import com.google.gson.JsonArray
+import com.google.gson.JsonParser
 import org.onap.aai.domain.yang.Relationship
 import org.onap.aaiclient.client.aai.AAIResourcesClient
 import org.onap.aaiclient.client.aai.entities.uri.AAIResourceUri
 import org.onap.so.beans.nsmf.AllocateTnNssi
-import org.onap.so.beans.nsmf.EsrInfo
 import org.onap.so.bpmn.core.UrnPropertiesReader
 import org.onap.so.bpmn.core.domain.ServiceDecomposition
 import org.onap.so.bpmn.core.domain.ServiceInstance
@@ -99,8 +98,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                                execution.setVariable("sliceProfile", sliceProfile)
                        }
                        String sliceProfileId = jsonUtil.getJsonValue(sliceProfile, "sliceProfileId")
-                       def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "snssaiList"))
-                       def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "plmnIdList"))
+                       def snssaiList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "sNSSAI"))
+                       def plmnIdList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "pLMNIdList"))
                        def coverageAreaTAList = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(sliceProfile, "coverageAreaTAList"))
 
                        if (isBlank(sliceProfileId) || (snssaiList.empty) || (plmnIdList.empty)
@@ -185,7 +184,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                List<String> nsstInfoList = new ArrayList<>()
                for(ServiceProxy serviceProxy : serviceProxyList)
                {
-                       String nsstModelUuid = serviceProxy.getModelInfo().getModelUuid()
+                       String nsstModelUuid = serviceProxy.getSourceModelUuid()
                        String nsstModelInvariantUuid = serviceProxy.getModelInfo().getModelInvariantUuid()
                        String name = serviceProxy.getModelInfo().getModelName()
                        String nsstServiceModelInfo = """{
@@ -203,7 +202,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                        logger.info(msg)
                        exceptionUtil.buildAndThrowWorkflowException(execution, 7000, msg)
                }
-               execution.setVariable("ranNsstInfoList",nsstInfoList)
+               execution.setVariable("ranNsstInfoList", objectMapper.writeValueAsString(nsstInfoList))
                execution.setVariable("ranModelVersion", ranModelVersion)
                execution.setVariable("ranModelName", ranModelName)
                execution.setVariable("currentIndex",currentIndex)
@@ -255,7 +254,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
 
                String urlString = UrnPropertiesReader.getVariable("mso.oof.endpoint", execution)
                logger.debug( "get NSSI option OOF Url: " + urlString)
-
+               JsonParser parser = new JsonParser()
                //build oof request body
                boolean ranNssiPreferReuse = execution.getVariable("ranNssiPreferReuse");
                String requestId = execution.getVariable("msoRequestId")
@@ -265,7 +264,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                String modelInvariantUuid = execution.getVariable("modelInvariantUuid")
                String modelName = execution.getVariable("ranModelName")
                String timeout = UrnPropertiesReader.getVariable("mso.adapters.oof.timeout", execution);
-               List<String> nsstInfoList =  objectMapper.readValue(execution.getVariable("nsstInfoList"), List.class)
+               List<String> nsstInfoList =  objectMapper.readValue(execution.getVariable("ranNsstInfoList"), List.class)
                JsonArray capabilitiesList = new JsonArray()
                String FHCapabilities = execution.getVariable("FHCapabilities")
                String MHCapabilities = execution.getVariable("MHCapabilities")
@@ -274,11 +273,11 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                JsonObject MH = new JsonObject()
                JsonObject ANNF = new JsonObject()
                FH.addProperty("domainType", "TN_FH")
-               FH.addProperty("capabilityDetails", FHCapabilities)
+               FH.add("capabilityDetails", (JsonObject) parser.parse(FHCapabilities))
                MH.addProperty("domainType", "TN_MH")
-               MH.addProperty("capabilityDetails", MHCapabilities)
+               MH.add("capabilityDetails", (JsonObject) parser.parse(MHCapabilities))
                ANNF.addProperty("domainType", "AN_NF")
-               ANNF.addProperty("capabilityDetails", FHCapabilities)
+               ANNF.add("capabilityDetails", (JsonObject) parser.parse(ANNFCapabilities))
                capabilitiesList.add(FH)
                capabilitiesList.add(MH)
                capabilitiesList.add(ANNF)
@@ -302,13 +301,18 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                String oofResponse = execution.getVariable("nssiSelection_asyncCallbackResponse")
                String requestStatus = jsonUtil.getJsonValue(oofResponse, "requestStatus")
                if(requestStatus.equals("completed")) {
-                       List<String> solution = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(oofResponse, "solutions"))
-                       boolean existingNSI = jsonUtil.getJsonValue(solution.get(0), "existingNSI")
+                       String solutions = jsonUtil.getJsonValue(oofResponse, "solutions")
+                       logger.debug("solutions value : "+solutions)
+                       JsonParser parser = new JsonParser()
+                       JsonArray solution = parser.parse(solutions)
+                       JsonObject sol = solution.get(0)
+                       boolean existingNSI = sol.get("existingNSI").getAsBoolean()
+                       logger.debug("existingNSI value : "+existingNSI)
                        if(existingNSI) {
-                               def sharedNSISolution = jsonUtil.getJsonValue(solution.get(0), "sharedNSISolution")
-                               execution.setVariable("sharedRanNSSISolution", sharedNSISolution)
+                               JsonObject sharedNSISolution = sol.get("sharedNSISolution").getAsJsonObject()
+                               execution.setVariable("sharedRanNSSISolution", sharedNSISolution.toString())
                                logger.debug("sharedRanNSSISolution from OOF "+sharedNSISolution)
-                               String RANServiceInstanceId = jsonUtil.getJsonValue(solution.get(0), "sharedNSISolution.NSIId")
+                               String RANServiceInstanceId = sharedNSISolution.get("NSIId").getAsString()
                                execution.setVariable("RANServiceInstanceId", RANServiceInstanceId)
                                ServiceInstance serviceInstance = new ServiceInstance();
                                serviceInstance.setInstanceId(RANServiceInstanceId);
@@ -317,9 +321,10 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                                execution.setVariable("ranNsstServiceDecomposition", serviceDecomposition)
                                execution.setVariable("isRspRanNssi", true)
                        }else {
-                               def sliceProfiles = jsonUtil.getJsonValue(solution.get(0), "newNSISolution.sliceProfiles")
-                               execution.setVariable("RanConstituentSliceProfiles", sliceProfiles)
+                               JsonObject newNSISolution = sol.get("newNSISolution").getAsJsonObject()
+                               JsonArray sliceProfiles = newNSISolution.get("slice_profiles").getAsJsonArray()
                                logger.debug("RanConstituentSliceProfiles list from OOF "+sliceProfiles)
+                               execution.setVariable("RanConstituentSliceProfiles", sliceProfiles.toString())
                        }
                }else {
                        String statusMessage = jsonUtil.getJsonValue(oofResponse, "statusMessage")
@@ -362,11 +367,11 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
        
        def createModifyNssiQueryJobStatus = { DelegateExecution execution ->
                logger.debug(Prefix+"createModifyNssiQueryJobStatus method start")
-               EsrInfo esrInfo = new EsrInfo()
-               esrInfo.setNetworkType("AN")
-               esrInfo.setVendor("ONAP")
-               String esrInfoString = objectMapper.writeValueAsString(esrInfo)
-               execution.setVariable("esrInfo", esrInfoString)
+               JsonObject esrInfo = new JsonObject()
+           esrInfo.addProperty("networkType", "tn")
+           esrInfo.addProperty("vendor", "ONAP_internal")
+
+               execution.setVariable("esrInfo", esrInfo.toString())
                JsonObject serviceInfo = new JsonObject()
                serviceInfo.addProperty("nssiId", execution.getVariable("RANServiceInstanceId"))
                serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
@@ -491,12 +496,16 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                String oofResponse = execution.getVariable("nfNssiSelection_asyncCallbackResponse")
                String requestStatus = jsonUtil.getJsonValue(oofResponse, "requestStatus")
                if(requestStatus.equals("completed")) {
-                       List<String> solution = jsonUtil.StringArrayToList(jsonUtil.getJsonValue(oofResponse, "solutions"))             
+                       String solutions = jsonUtil.getJsonValue(oofResponse, "solutions")
+                       logger.debug("nssi solutions value : "+solutions)
+                       JsonParser parser = new JsonParser()
+                       JsonArray solution = parser.parse(solutions)            
                        if(solution.size()>=1) {
-                               String ranNfNssiId = jsonUtil.getJsonValue(solution.get(0), "NSSIId")
-                               String invariantUuid = jsonUtil.getJsonValue(solution.get(0), "invariantUUID")
-                               String uuid = jsonUtil.getJsonValue(solution.get(0), "UUID")
-                               String nssiName = jsonUtil.getJsonValue(solution.get(0), "NSSIName")
+                               JsonObject sol = solution.get(0)
+                               String ranNfNssiId = sol.get("NSSIId").getAsString()
+                               String invariantUuid = sol.get("invariantUUID").getAsString()
+                               String uuid = sol.get("UUID").getAsString()
+                               String nssiName = sol.get("NSSIName").getAsString()
                                execution.setVariable("RANNFServiceInstanceId", ranNfNssiId)
                                execution.setVariable("RANNFInvariantUUID", invariantUuid)
                                execution.setVariable("RANNFUUID", uuid)
@@ -528,7 +537,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                logger.debug(Prefix+"processRanNfModifyRsp method start")
                anNssmfUtils.processRanNfModifyRsp(execution)
                //create RAN NSSI 
-               org.onap.aai.domain.yang.ServiceInstance ANServiceInstance = new ServiceInstance();
+               org.onap.aai.domain.yang.ServiceInstance ANServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
                //AN instance creation
                ANServiceInstance.setServiceInstanceId(execution.getVariable("RANServiceInstanceId"))
                String sliceInstanceName = execution.getVariable("servicename")
@@ -593,8 +602,8 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
        def updateAaiWithRANInstances = { DelegateExecution execution ->
                logger.debug(Prefix+"updateAaiWithRANInstances method start")
                //create RAN NSSI 
-               org.onap.aai.domain.yang.ServiceInstance ANServiceInstance = new ServiceInstance();
-               org.onap.aai.domain.yang.ServiceInstance ANNFServiceInstance = new ServiceInstance();
+               org.onap.aai.domain.yang.ServiceInstance ANServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
+               org.onap.aai.domain.yang.ServiceInstance ANNFServiceInstance = new org.onap.aai.domain.yang.ServiceInstance();
                //AN instance creation
                ANServiceInstance.setServiceInstanceId(execution.getVariable("RANServiceInstanceId"))
                String sliceInstanceName = execution.getVariable("servicename")
@@ -603,15 +612,16 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                ANServiceInstance.setServiceType(serviceType)
                String serviceStatus = "deactivated"
                ANServiceInstance.setOrchestrationStatus(serviceStatus)
-               String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "plmnIdList")
+               String serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "pLMNIdList")
                ANServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
                String serviceRole = "nssi"
                ANServiceInstance.setServiceRole(serviceRole)
-               List<String> snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+               List<String> snssaiList = execution.getVariable("snssaiList")
                String snssai = snssaiList.get(0)
                ANServiceInstance.setEnvironmentContext(snssai)
                ANServiceInstance.setWorkloadContext("AN")
-               
+               String serviceFunctionAn = jsonUtil.getJsonValue(execution.getVariable("sliceProfile"), "resourceSharingLevel")
+               ANServiceInstance.setServiceFunction(serviceFunctionAn)
                logger.debug("completed AN service instance build "+ ANServiceInstance.toString())
                //create RAN NF NSSI
                ANNFServiceInstance.setServiceInstanceId(execution.getVariable("RANNFServiceInstanceId"))
@@ -619,13 +629,15 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                ANNFServiceInstance.setServiceInstanceName(sliceInstanceName)
                ANNFServiceInstance.setServiceType(serviceType)
                ANNFServiceInstance.setOrchestrationStatus(serviceStatus)
-               serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "plmnIdList")
+               serviceInstanceLocationid = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "pLMNIdList")
                ANNFServiceInstance.setServiceInstanceLocationId(serviceInstanceLocationid)
                ANNFServiceInstance.setServiceRole(serviceRole)
-               snssaiList = objectMapper.readValue(execution.getVariable("snssaiList"), List.class)
+               snssaiList = execution.getVariable("snssaiList")
                snssai = snssaiList.get(0)
                ANNFServiceInstance.setEnvironmentContext(snssai)
                ANNFServiceInstance.setWorkloadContext("AN-NF")
+               String serviceFunctionAnnf = jsonUtil.getJsonValue(execution.getVariable("ranNfSliceProfile"), "resourceSharingLevel")
+               ANNFServiceInstance.setServiceFunction(serviceFunctionAnnf)
                logger.debug("completed AN service instance build "+ ANNFServiceInstance.toString())
                
                String msg = ""
@@ -695,11 +707,10 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
        }
        
        private void createTnAllocateNssiJobQuery(DelegateExecution execution, String domainType) {
-               EsrInfo esrInfo = new EsrInfo()
-               esrInfo.setNetworkType("TN")
-               esrInfo.setVendor("ONAP")
-               String esrInfoString = objectMapper.writeValueAsString(esrInfo)
-               execution.setVariable("esrInfo", esrInfoString)
+               JsonObject esrInfo = new JsonObject()
+           esrInfo.addProperty("networkType", "tn")
+           esrInfo.addProperty("vendor", "ONAP_internal")
+               execution.setVariable("esrInfo", esrInfo.toString())
                JsonObject serviceInfo = new JsonObject()
                serviceInfo.addProperty("nssiId", null)
                serviceInfo.addProperty("nsiId", execution.getVariable("nsiId"))
@@ -853,7 +864,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                updateStatus.setResourceTemplateUUID(nsiId)
                updateStatus.setResourceInstanceID(nssiId)
                updateStatus.setOperType("Allocate")
-               updateStatus.setProgress(100)
+               updateStatus.setProgress("100")
                updateStatus.setStatus("finished")
                requestDBUtil.prepareUpdateResourceOperationStatus(execution, updateStatus)
 
@@ -875,7 +886,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                updateStatus.setResourceTemplateUUID(nsiId)
                updateStatus.setResourceInstanceID(nssiId)
                updateStatus.setOperType("Allocate")
-               updateStatus.setProgress(0)
+               updateStatus.setProgress("0")
                updateStatus.setStatus("failed")
                requestDBUtil.prepareUpdateResourceOperationStatus(execution, updateStatus)
        }
@@ -883,8 +894,6 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
        private String buildSdnrAllocateRequest(DelegateExecution execution, String action, String rpcName, String callbackUrl) {
                
                String requestId = execution.getVariable("msoRequestId")
-               Date date = new Date().getTime()
-               Timestamp time = new Timestamp(date)
                Map<String,Object> sliceProfile = objectMapper.readValue(execution.getVariable("ranNfSliceProfile"), Map.class)
                sliceProfile.put("sliceProfileId", execution.getVariable("ANNF_sliceProfileInstanceId"))
                sliceProfile.put("maxNumberofConns", sliceProfile.get("maxNumberofPDUSessions"))
@@ -897,7 +906,7 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                JsonObject commonHeader = new JsonObject()
                JsonObject payload = new JsonObject()
                JsonObject payloadInput = new JsonObject()
-               commonHeader.addProperty("TimeStamp", time.toString())
+               commonHeader.addProperty("TimeStamp",new Date(System.currentTimeMillis()).format("yyyy-MM-dd'T'HH:mm:ss.sss", TimeZone.getDefault()))
                commonHeader.addProperty("APIver", "1.0")
                commonHeader.addProperty("RequestID", requestId)
                commonHeader.addProperty("SubRequestID", "1")
@@ -912,12 +921,12 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                payload.add("input", payloadInput)
                input.add("CommonHeader", commonHeader)
                input.addProperty("Action", action)
-               input.add("Payload", payload)
+               input.addProperty("Payload", payload.toString())
                body.add("input", input)
                response.add("body", body)
                response.addProperty("version", "1.0")
                response.addProperty("rpc-name", rpcName)
-               response.addProperty("correlation-id", requestId+"-1")
+               response.addProperty("correlation-id", (requestId+"-1"))
                response.addProperty("type", "request")
                return response.toString()
        }
@@ -979,8 +988,15 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                String DUEG_routeId = UUID.randomUUID().toString()
                execution.setVariable("tranportEp_ID_DUEG", DUEG_routeId)
                NetworkRoute DUEG_ep = new NetworkRoute()
-               DU_ep.setRouteId(DUEG_routeId)
-               DU_ep.setNextHop("Host3")
+                DUEG_ep.setRouteId(DUEG_routeId)
+                DUEG_ep.setFunction(function)
+                DUEG_ep.setRole(role)
+                DUEG_ep.setType(type)
+                DUEG_ep.setIpAddress("192.168.100.5")
+                DUEG_ep.setLogicalInterfaceId("1234")
+                DUEG_ep.setPrefixLength(prefixLength)
+                DUEG_ep.setAddressFamily(addressFamily)
+               DUEG_ep.setNextHop("Host3")
                //CUIN
                String CUIN_routeId = UUID.randomUUID().toString()
                execution.setVariable("tranportEp_ID_CUIN", CUIN_routeId)
@@ -1005,9 +1021,9 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
                        logger.debug("creating DUIN endpoint . ID : "+DUIN_routeId+" node details : "+DU_ep.toString())
                        networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), DUIN_routeId)
                        client.create(networkRouteUri, DU_ep)
-                       logger.debug("creating DUEG endpoint . ID : "+DUEG_routeId+" node details : "+DU_ep.toString())
+                       logger.debug("creating DUEG endpoint . ID : "+DUEG_routeId+" node details : "+DUEG_ep.toString())
                        networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), DUEG_routeId)
-                       client.create(networkRouteUri, DU_ep)
+                       client.create(networkRouteUri, DUEG_ep)
                        logger.debug("creating CUIN endpoint . ID : "+CUIN_routeId+" node details : "+CUIN_ep.toString())
                        networkRouteUri = AAIUriFactory.createResourceUri( new AAIObjectType(AAINamespaceConstants.NETWORK, NetworkRoute.class), CUIN_routeId)
                        client.create(networkRouteUri, CUIN_ep)
@@ -1041,3 +1057,4 @@ class DoAllocateAccessNSSI extends AbstractServiceTaskProcessor {
        }
        }
 }
+
index 159f4c4..fac8871 100644 (file)
@@ -555,8 +555,11 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
         //todo: endpointId -> set into tn
         allocateTnNssi.setTransportSliceNetworks()
         allocateTnNssi.setNetworkSliceInfos()
-
-
+        allocateTnNssi.setSliceProfile(sliceTaskInfo.sliceProfile.trans2TnProfile())
+        NsiInfo nsiInfo = new NsiInfo()
+        nsiInfo.setNsiId(sliceParams.suggestNsiId)
+        nsiInfo.setNsiName(sliceParams.suggestNsiName)
+        allocateTnNssi.setNsiInfo(nsiInfo)
 
         //allocateTnNssi.networkSliceInfos
 
@@ -768,7 +771,7 @@ class DoAllocateNSIandNSSI extends AbstractServiceTaskProcessor{
         ServiceInstance rspi = new ServiceInstance()
         rspi.setServiceInstanceName(sliceTaskInfo.NSSTInfo.name)
         rspi.setServiceType(sliceTaskInfo.sliceProfile.getSST())
-        rspi.setServiceRole("slice-profile-instance")
+        rspi.setServiceRole("slice-profile")
         rspi.setOrchestrationStatus(oStatus)
         rspi.setServiceInstanceLocationId(sliceTaskInfo.sliceProfile.getPLMNIdList())
         rspi.setModelInvariantId(sliceTaskInfo.NSSTInfo.invariantUUID)
index 217b3a8..5e281cf 100644 (file)
@@ -78,6 +78,7 @@ public class WorkflowActionBBTasks {
     private static final String ROLLBACKTOCREATEDNOCONFIGURATION = "RollbackToCreatedNoConfiguration";
     private static final String REPLACEINSTANCE = "replaceInstance";
     private static final String VFMODULE = "VfModule";
+    private static final String CONFIGURATION_PATTERN = "(Ad|De)(.*)FabricConfiguration(.*)";
     protected String maxRetries = "mso.rainyDay.maxRetries";
     private static final Logger logger = LoggerFactory.getLogger(WorkflowActionBBTasks.class);
 
@@ -99,22 +100,26 @@ public class WorkflowActionBBTasks {
     private RequestsDbListenerRunner requestsDbListener;
 
     public void selectBB(DelegateExecution execution) {
-        List<ExecuteBuildingBlock> flowsToExecute =
-                (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
-        execution.setVariable("MacroRollback", false);
         try {
-            flowManipulatorListenerRunner.modifyFlows(flowsToExecute, new DelegateExecutionImpl(execution));
-        } catch (NullPointerException ex) {
-            workflowAction.buildAndThrowException(execution, "Error in FlowManipulator Modify Flows", ex);
-        }
-        int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
+            List<ExecuteBuildingBlock> flowsToExecute =
+                    (List<ExecuteBuildingBlock>) execution.getVariable("flowsToExecute");
+            execution.setVariable("MacroRollback", false);
+            try {
+                flowManipulatorListenerRunner.modifyFlows(flowsToExecute, new DelegateExecutionImpl(execution));
+            } catch (NullPointerException ex) {
+                workflowAction.buildAndThrowException(execution, "Error in FlowManipulator Modify Flows", ex);
+            }
+            int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
 
-        ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence);
+            ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence);
 
-        execution.setVariable("buildingBlock", ebb);
-        currentSequence++;
-        execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size());
-        execution.setVariable(G_CURRENT_SEQUENCE, currentSequence);
+            execution.setVariable("buildingBlock", ebb);
+            currentSequence++;
+            execution.setVariable(COMPLETED, currentSequence >= flowsToExecute.size());
+            execution.setVariable(G_CURRENT_SEQUENCE, currentSequence);
+        } catch (Exception e) {
+            workflowAction.buildAndThrowException(execution, "Internal Error occured during selectBB", e);
+        }
     }
 
     public void updateFlowStatistics(DelegateExecution execution) {
@@ -417,12 +422,9 @@ public class WorkflowActionBBTasks {
         String handlingCode = (String) execution.getVariable(HANDLINGCODE);
         final boolean aLaCarte = (boolean) execution.getVariable(G_ALACARTE);
         int currentSequence = (int) execution.getVariable(G_CURRENT_SEQUENCE);
-        String requestAction = (String) execution.getVariable(G_ACTION);
         ExecuteBuildingBlock ebb = flowsToExecute.get(currentSequence - 1);
         String bbFlowName = ebb.getBuildingBlock().getBpmnFlowName();
-        if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)
-                && !(requestAction.equalsIgnoreCase("replaceInstance")
-                        || requestAction.equalsIgnoreCase("replaceInstanceRetainAssignments"))) {
+        if ("ActivateVfModuleBB".equalsIgnoreCase(bbFlowName) && aLaCarte && "Success".equalsIgnoreCase(handlingCode)) {
             postProcessingExecuteBBActivateVfModule(execution, ebb, flowsToExecute);
         }
     }
@@ -430,6 +432,7 @@ public class WorkflowActionBBTasks {
     protected void postProcessingExecuteBBActivateVfModule(DelegateExecution execution, ExecuteBuildingBlock ebb,
             List<ExecuteBuildingBlock> flowsToExecute) {
         try {
+            String requestAction = (String) execution.getVariable(G_ACTION);
             String serviceInstanceId = ebb.getWorkflowResourceIds().getServiceInstanceId();
             String vnfId = ebb.getWorkflowResourceIds().getVnfId();
             String vfModuleId = ebb.getResourceId();
@@ -444,26 +447,40 @@ public class WorkflowActionBBTasks {
             for (Vnfc vnfc : vnfcs) {
                 String modelCustomizationId = vnfc.getModelCustomizationId();
                 logger.debug("Processing Vnfc: {}", modelCustomizationId);
-                CvnfcConfigurationCustomization fabricConfig = catalogDbClient.getCvnfcCustomization(serviceModelUUID,
-                        vnfCustomizationUUID, vfModuleCustomizationUUID, modelCustomizationId);
-                if (fabricConfig != null && fabricConfig.getConfigurationResource() != null
-                        && fabricConfig.getConfigurationResource().getToscaNodeType() != null
-                        && fabricConfig.getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) {
-                    String configurationId = getConfigurationId(vnfc);
-                    ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys();
-                    configurationResourceKeys.setCvnfcCustomizationUUID(modelCustomizationId);
-                    configurationResourceKeys.setVfModuleCustomizationUUID(vfModuleCustomizationUUID);
-                    configurationResourceKeys.setVnfResourceCustomizationUUID(vnfCustomizationUUID);
-                    configurationResourceKeys.setVnfcName(vnfc.getVnfcName());
-                    ExecuteBuildingBlock addConfigBB = getExecuteBBForConfig(ADD_FABRIC_CONFIGURATION_BB, ebb,
-                            configurationId, configurationResourceKeys);
-                    flowsToExecute.add(addConfigBB);
-                    flowsToExecute.forEach(executeBB -> logger.info("Flows to Execute After Post Processing: {}",
-                            executeBB.getBuildingBlock().getBpmnFlowName()));
+                if (requestAction.equalsIgnoreCase("replaceInstance")
+                        || requestAction.equalsIgnoreCase("replaceInstanceRetainAssignments")) {
+                    List<ExecuteBuildingBlock> configBBs = flowsToExecute.stream()
+                            .filter(item -> !item.getBuildingBlock().getBpmnFlowName().matches(CONFIGURATION_PATTERN))
+                            .collect(Collectors.toList());
+                    for (ExecuteBuildingBlock bb : configBBs) {
+                        bb.getConfigurationResourceKeys().setCvnfcCustomizationUUID(modelCustomizationId);
+                        bb.getConfigurationResourceKeys().setVnfcName(vnfc.getVnfcName());
+                    }
                     execution.setVariable("flowsToExecute", flowsToExecute);
                     execution.setVariable(COMPLETED, false);
                 } else {
-                    logger.debug("No cvnfcCustomization found for customizationId: {}", modelCustomizationId);
+                    CvnfcConfigurationCustomization fabricConfig = catalogDbClient.getCvnfcCustomization(
+                            serviceModelUUID, vnfCustomizationUUID, vfModuleCustomizationUUID, modelCustomizationId);
+                    if (fabricConfig != null && fabricConfig.getConfigurationResource() != null
+                            && fabricConfig.getConfigurationResource().getToscaNodeType() != null && fabricConfig
+                                    .getConfigurationResource().getToscaNodeType().contains(FABRIC_CONFIGURATION)) {
+                        String configurationId = getConfigurationId(vnfc);
+                        ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys();
+                        configurationResourceKeys.setCvnfcCustomizationUUID(modelCustomizationId);
+                        configurationResourceKeys.setVfModuleCustomizationUUID(vfModuleCustomizationUUID);
+                        configurationResourceKeys.setVnfResourceCustomizationUUID(vnfCustomizationUUID);
+                        configurationResourceKeys.setVnfcName(vnfc.getVnfcName());
+                        ExecuteBuildingBlock addConfigBB = getExecuteBBForConfig(ADD_FABRIC_CONFIGURATION_BB, ebb,
+                                configurationId, configurationResourceKeys);
+                        flowsToExecute.add(addConfigBB);
+                        flowsToExecute.stream()
+                                .forEach(executeBB -> logger.info("Flows to Execute After Post Processing: {}",
+                                        executeBB.getBuildingBlock().getBpmnFlowName()));
+                        execution.setVariable("flowsToExecute", flowsToExecute);
+                        execution.setVariable(COMPLETED, false);
+                    } else {
+                        logger.debug("No cvnfcCustomization found for customizationId: {}", modelCustomizationId);
+                    }
                 }
             }
         } catch (EntityNotFoundException e) {
index b74aa90..60ad211 100644 (file)
@@ -54,14 +54,14 @@ public class CnfAdapterClient {
     @Autowired
     private Environment env;
 
-    private static final String INSTANCE_CREATE_PATH = "/api/multicloud-k8s/v1/v1/instance";
+    private static final String INSTANCE_CREATE_PATH = "/api/cnf-adapter/v1/instance";
 
     @Retryable(value = {HttpServerErrorException.class}, maxAttempts = 3, backoff = @Backoff(delay = 3000))
     public InstanceResponse createVfModule(InstanceRequest request) throws CnfAdapterClientException {
         try {
             // String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well
             // for configuration
-            String uri = "https://localhost:32780"; // TODO: What is the correct uri?
+            String uri = "https://cnf-adapter:8090"; // TODO: What is the correct uri?
             String endpoint = UriBuilder.fromUri(uri).path(INSTANCE_CREATE_PATH).build().toString();
             HttpEntity<?> entity = getHttpEntity(request);
             ResponseEntity<InstanceResponse> result =
@@ -81,7 +81,7 @@ public class CnfAdapterClient {
         try {
             // String uri = env.getRequiredProperty("mso.cnf.adapter.endpoint"); //TODO: This needs to be added as well
             // for configuration
-            String uri = "https://localhost:32780"; // TODO: What is the correct uri?
+            String uri = "https://cnf-adapter:8090"; // TODO: What is the correct uri?
             String endpoint = UriBuilder.fromUri(uri).path("/api/cnf-adapter/v1/healthcheck").build().toString();
             HttpEntity<?> entity = new HttpEntity<>(getHttpHeaders());
             ResponseEntity<InstanceResponse> result =
index 6278d48..7291b71 100644 (file)
 package org.onap.so.client.adapter.vnf.mapper;
 
 import java.io.Serializable;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 public class AttributeNameValue implements Serializable {
     private static final long serialVersionUID = -5215028275587848311L;
 
+    @JsonProperty("attribute_name")
     private String attributeName;
+    @JsonProperty("attribute_value")
     private transient Object attributeValue;
 
-    public AttributeNameValue(String attributeName, Object attributeValue) {
-        this.attributeName = attributeName;
-        this.attributeValue = attributeValue;
-    }
-
     public String getAttributeName() {
         return attributeName;
     }
index 59da22f..7c686bd 100644 (file)
@@ -235,7 +235,10 @@ public class VnfAdapterVfModuleObjectMapper {
                         logger.error("No value tag found for attribute: {}", attributeName);
                         throw new MissingValueTagException("No value tag found for " + attributeName);
                     }
-                    directives.append(new AttributeNameValue(attributeName, attributeValue.toString()));
+                    String nameValue = new StringBuilder().append("{\"attribute_name\": \"").append(attributeName)
+                            .append("\", \"attribute_value\": \"").append(attributeValue.toString()).append("\"}")
+                            .toString();
+                    directives.append(nameValue);
                     if (i < (srcMap.size() - 1 + noOfDirectivesSize))
                         directives.append(", ");
                     i++;
index 3290bb3..0384a28 100644 (file)
@@ -29,6 +29,7 @@ import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.ExpectedException;
+import org.mockito.ArgumentCaptor;
 import org.mockito.InjectMocks;
 import org.mockito.Mock;
 import org.mockito.Mockito;
@@ -47,23 +48,30 @@ import org.onap.so.bpmn.servicedecomposition.entities.BuildingBlock;
 import org.onap.so.bpmn.servicedecomposition.entities.ConfigurationResourceKeys;
 import org.onap.so.bpmn.servicedecomposition.entities.ExecuteBuildingBlock;
 import org.onap.so.bpmn.servicedecomposition.entities.WorkflowResourceIds;
+import org.onap.so.client.namingservice.NamingRequestObject;
+import org.onap.so.db.catalog.beans.ConfigurationResource;
+import org.onap.so.db.catalog.beans.CvnfcConfigurationCustomization;
 import org.onap.so.db.catalog.beans.VnfResourceCustomization;
 import org.onap.so.db.request.beans.InfraActiveRequests;
 import org.onap.so.serviceinstancebeans.ModelInfo;
 import org.onap.so.serviceinstancebeans.RequestDetails;
 import org.springframework.core.env.Environment;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.List;
 import java.util.Optional;
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
+import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.ArgumentMatchers.anyObject;
 import static org.mockito.ArgumentMatchers.anyString;
 import static org.mockito.ArgumentMatchers.isA;
 import static org.mockito.Mockito.doNothing;
 import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
 
 public class WorkflowActionBBTasksTest extends BaseTaskTest {
@@ -96,6 +104,9 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
+    @Mock
+    private DelegateExecution mockExecution;
+
     @Before
     public void before() throws Exception {
         execution = new DelegateExecutionFake();
@@ -603,6 +614,87 @@ public class WorkflowActionBBTasksTest extends BaseTaskTest {
 
     @Test
     public void postProcessingExecuteBBActivateVfModuleTest() throws CloneNotSupportedException {
+
+        BuildingBlock bbAddFabric = new BuildingBlock().setBpmnFlowName("AddFabricConfigurationBB");
+        ExecuteBuildingBlock ebbAddFabric = new ExecuteBuildingBlock().setBuildingBlock(bbAddFabric);
+        WorkflowResourceIds workflowResourceIds = new WorkflowResourceIds();
+        workflowResourceIds.setServiceInstanceId("1");
+        workflowResourceIds.setVnfId("1");
+        ebbAddFabric.setWorkflowResourceIds(workflowResourceIds);
+        ebbAddFabric.setResourceId("1");
+
+        BuildingBlock bbActivateVfModule = new BuildingBlock().setBpmnFlowName("ActivateVfModuleBB");
+        ExecuteBuildingBlock ebbActivateVfModule = new ExecuteBuildingBlock().setBuildingBlock(bbActivateVfModule);
+        ebbActivateVfModule.setWorkflowResourceIds(workflowResourceIds);
+        ebbActivateVfModule.setResourceId("1");
+        ConfigurationResourceKeys configurationResourceKeys = new ConfigurationResourceKeys();
+        ebbActivateVfModule.setConfigurationResourceKeys(configurationResourceKeys);
+
+        ServiceInstance service = new ServiceInstance();
+        service.setServiceInstanceName("name");
+        service.setModelVersionId("1");
+        doReturn(service).when(bbSetupUtils).getAAIServiceInstanceById("1");
+
+        GenericVnf vnf = new GenericVnf();
+        vnf.setVnfName("name");
+        vnf.setModelCustomizationId("1");
+        doReturn(vnf).when(bbSetupUtils).getAAIGenericVnf("1");
+
+        VfModule vfModule = new VfModule();
+        vfModule.setVfModuleName("name");
+        vfModule.setModelCustomizationId("1");
+        doReturn(vfModule).when(bbSetupUtils).getAAIVfModule("1", "1");
+
+        List<org.onap.aai.domain.yang.Vnfc> vnfcs = new ArrayList<org.onap.aai.domain.yang.Vnfc>();
+        org.onap.aai.domain.yang.Vnfc vnfc = new org.onap.aai.domain.yang.Vnfc();
+        vnfc.setModelInvariantId("1");
+        vnfc.setVnfcName("name");
+        vnfc.setModelCustomizationId("2");
+        vnfcs.add(vnfc);
+        doReturn(vnfcs).when(workflowAction).getRelatedResourcesInVfModule(any(), any(), any(), any());
+
+        CvnfcConfigurationCustomization vfModuleCustomization = new CvnfcConfigurationCustomization();
+        ConfigurationResource configuration = new ConfigurationResource();
+        configuration.setToscaNodeType("FabricConfiguration");
+        configuration.setModelUUID("1");
+        vfModuleCustomization.setConfigurationResource(configuration);
+
+        doReturn(vfModuleCustomization).when(catalogDbClient).getCvnfcCustomization("1", "1", "1", "2");
+
+        prepareDelegateExecution();
+        List<ExecuteBuildingBlock> flowsToExecute = new ArrayList<>();
+        flowsToExecute.add(ebbActivateVfModule);
+
+        ArgumentCaptor<DelegateExecution> executionCaptor = ArgumentCaptor.forClass(DelegateExecution.class);
+        ArgumentCaptor<ExecuteBuildingBlock> bbCaptor = ArgumentCaptor.forClass(ExecuteBuildingBlock.class);
+        ArgumentCaptor<List> listCaptor = ArgumentCaptor.forClass(List.class);
+        workflowActionBBTasks.postProcessingExecuteBBActivateVfModule(execution, ebbAddFabric, flowsToExecute);
+        verify(workflowActionBBTasks, times(1)).postProcessingExecuteBBActivateVfModule(executionCaptor.capture(),
+                bbCaptor.capture(), listCaptor.capture());
+        assertEquals(false, executionCaptor.getAllValues().get(0).getVariable("completed"));
+        assertEquals(2, ((ArrayList) executionCaptor.getAllValues().get(0).getVariable("flowsToExecute")).size());
+        assertEquals(null,
+                ((ExecuteBuildingBlock) ((ArrayList) executionCaptor.getAllValues().get(0)
+                        .getVariable("flowsToExecute")).get(0)).getConfigurationResourceKeys()
+                                .getCvnfcCustomizationUUID());
+
+
+        execution.setVariable("requestAction", "replaceInstance");
+        flowsToExecute = new ArrayList<>();
+        flowsToExecute.add(ebbActivateVfModule);
+        workflowActionBBTasks.postProcessingExecuteBBActivateVfModule(execution, ebbActivateVfModule, flowsToExecute);
+        verify(workflowActionBBTasks, times(2)).postProcessingExecuteBBActivateVfModule(executionCaptor.capture(),
+                bbCaptor.capture(), listCaptor.capture());
+        assertEquals(false, executionCaptor.getAllValues().get(0).getVariable("completed"));
+        assertEquals(1, ((ArrayList) executionCaptor.getAllValues().get(0).getVariable("flowsToExecute")).size());
+        assertEquals("2",
+                ((ExecuteBuildingBlock) ((ArrayList) executionCaptor.getAllValues().get(0)
+                        .getVariable("flowsToExecute")).get(0)).getConfigurationResourceKeys()
+                                .getCvnfcCustomizationUUID());
+    }
+
+    @Test
+    public void getExecuteBBForConfigTest() throws CloneNotSupportedException {
         BuildingBlock bbActivateVfModule = new BuildingBlock().setBpmnFlowName("ActivateVfModuleBB");
         ExecuteBuildingBlock ebbActivateVfModule = new ExecuteBuildingBlock().setBuildingBlock(bbActivateVfModule);
 
index 5b070bb..3b542fa 100644 (file)
@@ -26,11 +26,12 @@ import java.util.List;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
 @Data
+@Deprecated
 public class AdditionalProperties implements Serializable {
 
     private static final long serialVersionUID = -4020397418955518175L;
 
-    private SliceProfile sliceProfile;
+    private TnSliceProfile sliceProfile;
 
     private List<EndPoint> endPoints;
 
index f85cb0c..1b0986c 100644 (file)
@@ -30,7 +30,13 @@ public class AllocateTnNssi implements Serializable {
 
     private static final long serialVersionUID = -7069801712339914746L;
 
+    private TnSliceProfile sliceProfile;
+
     private List<NetworkSliceInfo> networkSliceInfos;
 
     private List<TransportSliceNetwork> transportSliceNetworks;
+
+    private NsiInfo nsiInfo;
+
+    private String scriptName;
 }
index 1fa84ee..3a45119 100644 (file)
@@ -32,12 +32,12 @@ public class CnSliceProfile implements Serializable {
 
     private static final long serialVersionUID = 6627071735572539536L;
 
-    @JsonProperty(value = "sNSSAIList", required = true)
+    @JsonProperty(value = "snssaiList", required = true)
     private List<String> snssaiList;
 
     private String sliceProfileId;
 
-    @JsonProperty(value = "pLMNIdList", required = true)
+    @JsonProperty(value = "plmnIdList", required = true)
     private List<String> plmnIdList;
 
     @JsonProperty(value = "perfReq", required = true)
index 99a8525..3bf2ffb 100644 (file)
 package org.onap.so.beans.nsmf;
 
 
+import lombok.Data;
 import java.io.Serializable;
 
-
+@Data
 public class ConnectionLink implements Serializable {
+
     private static final long serialVersionUID = -1834584960407180427L;
 
     private String transportEndpointA;
 
     private String transportEndpointB;
-
-    public static long getSerialVersionUID() {
-        return serialVersionUID;
-    }
-
-    public String getTransportEndpointA() {
-        return transportEndpointA;
-    }
-
-    public void setTransportEndpointA(String transportEndpointA) {
-        this.transportEndpointA = transportEndpointA;
-    }
-
-    public String getTransportEndpointB() {
-        return transportEndpointB;
-    }
-
-    public void setTransportEndpointB(String transportEndpointB) {
-        this.transportEndpointB = transportEndpointB;
-    }
 }
index 66bfbdc..4fc5932 100644 (file)
 package org.onap.so.beans.nsmf;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import java.io.Serializable;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class PnfErrorList {
+public class PnfErrorList implements Serializable {
+
+    private static final long serialVersionUID = 1506455363755909867L;
 
     private String pnfId;
 
index c71441a..ee027bc 100644 (file)
 package org.onap.so.beans.nsmf;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import java.io.Serializable;
 import java.util.List;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class ResponseHistory {
+public class ResponseHistory implements Serializable {
+
+    private static final long serialVersionUID = -1005342539496792450L;
 
     private int progress;
 
index 9b6df0f..ad6eec1 100644 (file)
@@ -90,7 +90,7 @@ public class SliceProfileAdapter implements Serializable {
     }
 
     private Integer str2Code(String area) {
-        return area.hashCode() >> 16;
+        return Math.abs(area.hashCode() >> 16);
     }
 
     public CnSliceProfile trans2CnProfile() {
@@ -100,6 +100,7 @@ public class SliceProfileAdapter implements Serializable {
         cnSliceProfile.setCoverageAreaTAList(Arrays.asList(this.coverageAreaTAList.split("\\|")));
         cnSliceProfile.setPlmnIdList(Arrays.asList(this.pLMNIdList.split("\\|")));
         cnSliceProfile.setResourceSharingLevel(ResourceSharingLevel.fromString(this.resourceSharingLevel));
+        cnSliceProfile.setUeMobilityLevel(UeMobilityLevel.fromString(this.uEMobilityLevel));
         PerfReq perfReq = new PerfReq();
         // todo
         cnSliceProfile.setPerfReq(perfReq);
index aa2579e..c0dd425 100644 (file)
@@ -25,6 +25,7 @@ import java.util.List;
 
 @Data
 public class TransportSliceNetwork implements Serializable {
+
     private static final long serialVersionUID = 809947462399806990L;
 
     private List<ConnectionLink> connectionLinks;
index 6388ca6..a3330e6 100644 (file)
 package org.onap.so.beans.nsmf;
 
 import com.fasterxml.jackson.annotation.JsonInclude;
+import java.io.Serializable;
 
 @JsonInclude(JsonInclude.Include.NON_NULL)
-public class VnfErrorList {
+public class VnfErrorList implements Serializable {
+
+    private static final long serialVersionUID = -2907819676875489281L;
 
     private String vnfInstanceId;
 
index ece1333..9fce328 100644 (file)
@@ -34,10 +34,12 @@ import java.util.List;
 import java.util.Map;
 import java.util.Map.Entry;
 import java.util.Optional;
+import java.util.concurrent.TimeUnit;
 import java.util.function.Predicate;
 import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
 import javax.ws.rs.client.Invocation.Builder;
+import javax.ws.rs.client.ResponseProcessingException;
 import javax.ws.rs.client.WebTarget;
 import javax.ws.rs.core.GenericType;
 import javax.ws.rs.core.MediaType;
@@ -187,7 +189,7 @@ public abstract class RestClient {
     }
 
     protected Client getClient() {
-        return ClientBuilder.newBuilder().build();
+        return ClientBuilder.newBuilder().readTimeout(props.getReadTimeout(), TimeUnit.MILLISECONDS).build();
     }
 
     protected abstract ONAPComponentsList getTargetEntity();
@@ -201,7 +203,6 @@ public abstract class RestClient {
         metricLogClientFilter = new SOMetricLogClientFilter();
         mdcSetup.setTargetEntity(getTargetEntity());
         client.register(metricLogClientFilter);
-
         if (!path.isPresent()) {
             webTarget = client.target(host.toString());
         } else {
@@ -225,6 +226,9 @@ public abstract class RestClient {
         result.add(e -> {
             return e.getCause() instanceof ConnectException;
         });
+        result.add(e -> {
+            return e.getCause() instanceof ResponseProcessingException;
+        });
         return result;
     }
 
index 1e89538..8956e20 100644 (file)
@@ -24,6 +24,7 @@ import java.net.URI;
 import java.security.KeyStore;
 import java.security.NoSuchAlgorithmException;
 import java.util.Optional;
+import java.util.concurrent.TimeUnit;
 import javax.net.ssl.SSLContext;
 import javax.ws.rs.client.Client;
 import javax.ws.rs.client.ClientBuilder;
@@ -56,7 +57,8 @@ public abstract class RestClientSSL extends RestClient {
                 }
             }
             // Use default SSL context
-            client = ClientBuilder.newBuilder().sslContext(SSLContext.getDefault()).build();
+            client = ClientBuilder.newBuilder().sslContext(SSLContext.getDefault())
+                    .readTimeout(props.getReadTimeout(), TimeUnit.MILLISECONDS).build();
             logger.info("RestClientSSL using default SSL context!");
         } catch (NoSuchAlgorithmException e) {
             throw new RuntimeException(e);
index 9e4e99c..36da424 100644 (file)
@@ -40,4 +40,13 @@ public interface RestProperties {
     public default boolean mapNotFoundToEmpty() {
         return false;
     }
+
+    /**
+     * Time in milliseconds
+     * 
+     * @return
+     */
+    public default Long getReadTimeout() {
+        return Long.valueOf(60000);
+    }
 }
index cd00a9e..c6e282c 100644 (file)
@@ -21,6 +21,8 @@
 package org.onap.so.client;
 
 
+import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
+import static com.github.tomakehurst.wiremock.client.WireMock.get;
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doThrow;
 import static org.mockito.Mockito.spy;
@@ -28,7 +30,13 @@ import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
 import java.net.MalformedURLException;
 import java.net.SocketTimeoutException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Map;
+import java.util.Optional;
 import javax.ws.rs.NotFoundException;
+import javax.ws.rs.ProcessingException;
 import javax.ws.rs.WebApplicationException;
 import javax.ws.rs.core.UriBuilder;
 import javax.ws.rs.core.UriBuilderException;
@@ -37,21 +45,24 @@ import org.junit.Test;
 import org.junit.rules.ExpectedException;
 import org.junit.runner.RunWith;
 import org.mockito.ArgumentMatchers;
-import org.mockito.Mock;
 import org.mockito.junit.MockitoJUnitRunner;
 import org.onap.logging.filter.base.ONAPComponents;
+import org.onap.logging.filter.base.ONAPComponentsList;
+import com.github.tomakehurst.wiremock.core.WireMockConfiguration;
+import com.github.tomakehurst.wiremock.junit.WireMockRule;
 
 @RunWith(MockitoJUnitRunner.class)
 public class RestClientTest {
 
 
     private final HttpClientFactory httpClientFactory = new HttpClientFactory();
-    @Mock
-    private RestProperties props;
 
     @Rule
     public ExpectedException thrown = ExpectedException.none();
 
+    @Rule
+    public WireMockRule wireMockRule = new WireMockRule(WireMockConfiguration.options().dynamicPort());
+
     @Test
     public void retries() throws Exception {
         RestClient spy = buildSpy();
@@ -80,6 +91,50 @@ public class RestClientTest {
 
     }
 
+    @Test
+    public void timeoutTest() throws URISyntaxException {
+        wireMockRule.stubFor(get("/chunked/delayed")
+                .willReturn(aResponse().withStatus(200).withBody("Hello world!").withChunkedDribbleDelay(2, 300)));
+
+
+        RestProperties props = new RestProperties() {
+
+            @Override
+            public URL getEndpoint() throws MalformedURLException {
+                return new URL(String.format("http://localhost:%s", wireMockRule.port()));
+            }
+
+            @Override
+            public String getSystemName() {
+                // TODO Auto-generated method stub
+                return null;
+            }
+
+            @Override
+            public Long getReadTimeout() {
+                return Long.valueOf(100);
+            }
+        };
+        RestClient client = new RestClient(props, Optional.of(new URI("/chunked/delayed"))) {
+
+            @Override
+            protected void initializeHeaderMap(Map<String, String> headerMap) {
+                // TODO Auto-generated method stub
+
+            }
+
+            @Override
+            protected ONAPComponentsList getTargetEntity() {
+                return ONAPComponents.EXTERNAL;
+            }
+
+        };
+
+        thrown.expect(ProcessingException.class);
+        client.get();
+
+    }
+
     private RestClient buildSpy() throws MalformedURLException, IllegalArgumentException, UriBuilderException {
         RestClient client = httpClientFactory.newJsonClient(UriBuilder.fromUri("http://localhost/test").build().toURL(),
                 ONAPComponents.BPMN);
index 8226278..6e6a9d2 100644 (file)
@@ -32,6 +32,7 @@ public class AaiClientPropertiesImpl implements AAIProperties {
     private String aaiEndpoint;
     private String auth;
     private String key;
+    private Long readTimeout;
 
     public AaiClientPropertiesImpl() {
 
@@ -39,6 +40,7 @@ public class AaiClientPropertiesImpl implements AAIProperties {
         aaiEndpoint = context.getEnvironment().getProperty("mso.aai.endpoint");
         this.auth = context.getEnvironment().getProperty("aai.auth");
         this.key = context.getEnvironment().getProperty("mso.msoKey");
+        this.readTimeout = context.getEnvironment().getProperty("aai.readTimeout", Long.class, new Long(60000));
     }
 
     @Override
@@ -65,4 +67,9 @@ public class AaiClientPropertiesImpl implements AAIProperties {
     public String getKey() {
         return this.key;
     }
+
+    @Override
+    public Long getReadTimeout() {
+        return this.readTimeout;
+    }
 }
index 3df3580..910d5fa 100644 (file)
@@ -33,14 +33,15 @@ public class AaiPropertiesImpl implements AAIProperties {
     private final String encryptedBasicAuth;
     private final String encryptionKey;
     private final String aaiVersion;
+    private final Long readTimeout;
 
     public AaiPropertiesImpl() {
-
         final ApplicationContext context = SpringContextHelper.getAppContext();
         this.endpoint = context.getEnvironment().getProperty("aai.endpoint");
         this.encryptedBasicAuth = context.getEnvironment().getProperty("aai.auth");
         this.encryptionKey = context.getEnvironment().getProperty("mso.key");
         this.aaiVersion = context.getEnvironment().getProperty("aai.version");
+        this.readTimeout = context.getEnvironment().getProperty("aai.readTimeout", Long.class, new Long(60000));
     }
 
     @Override
@@ -73,4 +74,9 @@ public class AaiPropertiesImpl implements AAIProperties {
     public String getKey() {
         return encryptionKey;
     }
+
+    @Override
+    public Long getReadTimeout() {
+        return this.readTimeout;
+    }
 }