From 9cebc7162dcb995f5cb47006a1d315abbc2abb73 Mon Sep 17 00:00:00 2001 From: c00149107 Date: Thu, 12 Oct 2017 10:38:49 +0800 Subject: Add global Customer Info for VFC Add global Customer Info for VFC NS Create Change-Id: I38fbd8c8bdc854b0f93ae2302d09f2725d83b67a Issue-ID:SO-211 Signed-off-by: c00149107 --- .../org/openecomp/mso/adapters/vfc/VfcManager.java | 10 +++- .../mso/adapters/vfc/model/CustomerModel.java | 69 ++++++++++++++++++++++ .../mso/adapters/vfc/model/NsCreateReq.java | 35 ++++++++--- 3 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java (limited to 'adapters/mso-vfc-adapter') diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java index 78ec50f9f0..03d427b467 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java @@ -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 index 0000000000..fa0347bf48 --- /dev/null +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/CustomerModel.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ +package org.openecomp.mso.adapters.vfc.model; + +/** + * The Customer Model + *
+ *

+ *

+ * + * @author + * @version ONAP Amsterdam Release 2017-10-12 + */ +public class CustomerModel { + + String globalCustomerId; + + String serviceType; + + + /** + * @return Returns the globalCustomerId. + */ + public String getGlobalCustomerId() { + return globalCustomerId; + } + + + /** + * @param globalCustomerId The globalCustomerId to set. + */ + public void setGlobalCustomerId(String globalCustomerId) { + this.globalCustomerId = globalCustomerId; + } + + + /** + * @return Returns the serviceType. + */ + public String getServiceType() { + return serviceType; + } + + + /** + * @param serviceType The serviceType to set. + */ + public void setServiceType(String serviceType) { + this.serviceType = serviceType; + } + +} diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java index 848ecf3114..3887624be0 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsCreateReq.java @@ -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; } /** -- cgit 1.2.3-korg