Add global Customer Info for VFC 09/18409/1
authorc00149107 <chenchuanyu@huawei.com>
Thu, 12 Oct 2017 02:38:49 +0000 (10:38 +0800)
committerc00149107 <chenchuanyu@huawei.com>
Thu, 12 Oct 2017 02:38:49 +0000 (10:38 +0800)
Add global Customer Info for VFC NS Create

Change-Id: I38fbd8c8bdc854b0f93ae2302d09f2725d83b67a
Issue-ID:SO-211
Signed-off-by: c00149107 <chenchuanyu@huawei.com>
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java [new file with mode: 0644]
adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java

index 78ec50f..03d427b 100644 (file)
@@ -28,6 +28,7 @@ import org.openecomp.mso.adapters.vfc.constant.CommonConstant.Step;
 import org.openecomp.mso.adapters.vfc.constant.DriverExceptionID;
 import org.openecomp.mso.adapters.vfc.constant.HttpCode;
 import org.openecomp.mso.adapters.vfc.exceptions.ApplicationException;
+import org.openecomp.mso.adapters.vfc.model.CustomerModel;
 import org.openecomp.mso.adapters.vfc.model.NSResourceInputParameter;
 import org.openecomp.mso.adapters.vfc.model.NsCreateReq;
 import org.openecomp.mso.adapters.vfc.model.NsInstantiateReq;
@@ -85,9 +86,9 @@ public class VfcManager {
   public RestfulResponse createNs(NSResourceInputParameter segInput) throws ApplicationException {
 
     // Step1: get service template by node type
-    String nsdId = segInput.getNsOperationKey().getNodeTemplateUUID();
+    String csarId = segInput.getNsOperationKey().getNodeTemplateUUID();
     // nsdId for NFVO is "id" in the response, while for SDNO is "servcice template id"
-    LOGGER.info("serviceTemplateId is {}, id is {}", nsdId);
+    LOGGER.info("serviceTemplateId is {}, id is {}", csarId);
 
     LOGGER.info("create ns -> begin");
     // Step2: Prepare url and method type
@@ -96,9 +97,12 @@ public class VfcManager {
 
     // Step3: Prepare restful parameters and options
     NsCreateReq oRequest = new NsCreateReq();
-    oRequest.setNsdId(nsdId);
+    oRequest.setCsarId(csarId);
     oRequest.setNsName(segInput.getNsServiceName());
     oRequest.setDescription(segInput.getNsServiceDescription());
+    CustomerModel context = new CustomerModel();
+    context.setGlobalCustomerId(segInput.getNsOperationKey().getGlobalSubscriberId());
+    context.setServiceType(segInput.getNsOperationKey().getServiceType());
     String createReq = JsonUtil.marshal(oRequest);
 
     // Step4: Call NFVO or SDNO lcm to create ns
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java
new file mode 100644 (file)
index 0000000..fa0347b
--- /dev/null
@@ -0,0 +1,69 @@
+/*-\r
+ * ============LICENSE_START=======================================================\r
+ * ONAP - SO\r
+ * ================================================================================\r
+ * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved.\r
+ * ================================================================================\r
+ * Licensed under the Apache License, Version 2.0 (the "License");\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ * \r
+ *      http://www.apache.org/licenses/LICENSE-2.0\r
+ * \r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an "AS IS" BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ * ============LICENSE_END=========================================================\r
+ */\r
+package org.openecomp.mso.adapters.vfc.model;\r
+\r
+/**\r
+ * The Customer Model\r
+ * <br>\r
+ * <p>\r
+ * </p>\r
+ * \r
+ * @author\r
+ * @version     ONAP Amsterdam Release  2017-10-12\r
+ */\r
+public class CustomerModel {\r
+    \r
+    String globalCustomerId;\r
+\r
+    String serviceType;\r
+\r
+    \r
+    /**\r
+     * @return Returns the globalCustomerId.\r
+     */\r
+    public String getGlobalCustomerId() {\r
+        return globalCustomerId;\r
+    }\r
+\r
+    \r
+    /**\r
+     * @param globalCustomerId The globalCustomerId to set.\r
+     */\r
+    public void setGlobalCustomerId(String globalCustomerId) {\r
+        this.globalCustomerId = globalCustomerId;\r
+    }\r
+\r
+    \r
+    /**\r
+     * @return Returns the serviceType.\r
+     */\r
+    public String getServiceType() {\r
+        return serviceType;\r
+    }\r
+\r
+    \r
+    /**\r
+     * @param serviceType The serviceType to set.\r
+     */\r
+    public void setServiceType(String serviceType) {\r
+        this.serviceType = serviceType;\r
+    }\r
+    \r
+}\r
index 848ecf3..3887624 100644 (file)
@@ -29,24 +29,45 @@ package org.openecomp.mso.adapters.vfc.model;
  */
 public class NsCreateReq {
 
-    String nsdId;
+    CustomerModel context;
+    
+    String csarId;
 
     String nsName;
 
     String description;
+    
+    
+    /**
+     * @return Returns the context.
+     */
+    public CustomerModel getContext() {
+        return context;
+    }
+
+
+    
+    /**
+     * @param context The context to set.
+     */
+    public void setContext(CustomerModel context) {
+        this.context = context;
+    }
+
 
     /**
-     * @return Returns the nsdId.
+     * @return Returns the csarId.
      */
-    public String getNsdId() {
-        return nsdId;
+    public String getCsarId() {
+        return csarId;
     }
 
+    
     /**
-     * @param nsdId The nsdId to set.
+     * @param csarId The csarId to set.
      */
-    public void setNsdId(String nsdId) {
-        this.nsdId = nsdId;
+    public void setCsarId(String csarId) {
+        this.csarId = csarId;
     }
 
     /**