diff options
author | c00149107 <chenchuanyu@huawei.com> | 2017-09-19 15:35:28 +0800 |
---|---|---|
committer | c00149107 <chenchuanyu@huawei.com> | 2017-09-19 15:35:28 +0800 |
commit | 1b02f2cd931caf4f8f705c115e8ba39a3916a602 (patch) | |
tree | 33d177e750794b01eea4f2a667eb8ac6aefedeef /adapters/mso-vfc-adapter/src/main/java/org/openecomp | |
parent | 3c6e2c520783eaf4a703ff2adfd94324d2fd3fae (diff) |
Add subscriber info for api
Add subscriber and service type for vf-c api
Change-Id: I07f99852708f52cafd9fd31b699c2d4233ffa21d
Issue-ID:SO-145
Signed-off-by: c00149107 <chenchuanyu@huawei.com>
Diffstat (limited to 'adapters/mso-vfc-adapter/src/main/java/org/openecomp')
3 files changed, 71 insertions, 20 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiUtil.java index 89c100d084..29f27d05e9 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiUtil.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiUtil.java @@ -32,13 +32,13 @@ import org.openecomp.mso.adapters.vfc.model.RestfulResponse; */ public class AaiUtil { - public static RestfulResponse addRelation(String serviceInstanceID, String resourceInstanceID) + public static RestfulResponse addRelation(String globalSubsriberId, String serviceType, String serviceInstanceId, String resourceInstanceId) { //sent rest to aai to add relation for service and ns. return null; } - public static RestfulResponse removeRelation(String serviceInstanceID ,String resourceInstanceID) + public static RestfulResponse removeRelation(String globalSubsriberId, String serviceType, String serviceInstanceId ,String resourceInstanceId) { //sent rest to aai to remove relation between service an ns. return null; 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 f4572c8351..c2d5fe241c 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 @@ -17,6 +17,7 @@ * limitations under the License. * ============LICENSE_END========================================================= */ + package org.openecomp.mso.adapters.vfc; import java.util.HashMap; @@ -51,7 +52,7 @@ import org.slf4j.LoggerFactory; * </p> * * @author - * @version ONAP Amsterdam Release 2017-08-28 + * @version ONAP Amsterdam Release 2017-08-28 */ public class VfcManager { @@ -71,14 +72,15 @@ public class VfcManager { nfvoUrlMap.put(Step.QUERY, CommonConstant.NFVO_QUERY_URL); } - public VfcManager(){ - + public VfcManager() { + } + /** * create network service * <br> * - * @param segInput input parameters for current node from http request + * @param segInput input parameters for current node from http request * @return * @since ONAP Amsterdam Release */ @@ -117,7 +119,9 @@ public class VfcManager { LOGGER.info("create ns -> end"); LOGGER.info("save segment and operaton info -> begin"); // Step 5: add relation between service and NS - AaiUtil.addRelation(segInput.getNsOperationKey().getServiceId(), nsInstanceId); + AaiUtil.addRelation(segInput.getNsOperationKey().getGlobalSubscriberId(), + segInput.getNsOperationKey().getServiceType(), segInput.getNsOperationKey().getServiceId(), + nsInstanceId); // Step 6: save resource operation information ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus( @@ -146,7 +150,7 @@ public class VfcManager { * @return * @since ONAP Amsterdam Release */ - public RestfulResponse deleteNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException{ + public RestfulResponse deleteNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException { LOGGER.info("delete ns -> begin"); // Step1: prepare url and methodType String url = getUrl(nsInstanceId, CommonConstant.Step.DELETE); @@ -158,8 +162,8 @@ public class VfcManager { LOGGER.info("delete ns response status is : {}", deleteRsp.getStatus()); LOGGER.info("delete ns response content is : {}", deleteRsp.getResponseContent()); LOGGER.info("delete ns -> end"); - ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus(nsOperationKey.getServiceId(), - nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID()); + ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus( + nsOperationKey.getServiceId(), nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID()); if(!HttpCode.isSucess(deleteRsp.getStatus())) { LOGGER.error("fail to delete ns"); @@ -171,7 +175,8 @@ public class VfcManager { } // Step3: remove relation info between service and ns - AaiUtil.removeRelation(nsOperationKey.getServiceId(), nsInstanceId); + AaiUtil.removeRelation(nsOperationKey.getGlobalSubscriberId(), nsOperationKey.getServiceType(), + nsOperationKey.getServiceId(), nsInstanceId); LOGGER.info("delete segment information -> end"); // Step4: update service segment operation status @@ -188,12 +193,13 @@ public class VfcManager { * instantiate network service * <br> * - * @param nsInstanceId The NS instance id + * @param nsInstanceId The NS instance id * @param segInput input parameters for current node from http request * @return * @since ONAP Amsterdam Release */ - public RestfulResponse instantiateNs(String nsInstanceId, NSResourceInputParameter segInput) throws ApplicationException{ + public RestfulResponse instantiateNs(String nsInstanceId, NSResourceInputParameter segInput) + throws ApplicationException { // Call the NFVO or SDNO service to instantiate service LOGGER.info("instantiate ns -> begin"); @@ -257,11 +263,11 @@ public class VfcManager { * @return * @since ONAP Amsterdam Release */ - public RestfulResponse terminateNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException{ + public RestfulResponse terminateNs(NsOperationKey nsOperationKey, String nsInstanceId) throws ApplicationException { // Step1: save segment operation info for delete process LOGGER.info("save segment operation for delete process"); - ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus(nsOperationKey.getServiceId(), - nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID()); + ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus( + nsOperationKey.getServiceId(), nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID()); nsOperInfo.setStatus(RequestsDbConstant.Status.PROCESSING); (RequestsDatabase.getInstance()).updateResOperStatus(nsOperInfo); @@ -322,12 +328,12 @@ public class VfcManager { * @return * @since ONAP Amsterdam Release */ - public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId) throws ApplicationException{ + public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId) throws ApplicationException { ValidateUtil.assertObjectNotNull(jobId); // Step 1: query the current resource operation status - ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus(nsOperationKey.getServiceId(), - nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID()); + ResourceOperationStatus nsOperInfo = (RequestsDatabase.getInstance()).getResourceOperationStatus( + nsOperationKey.getServiceId(), nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateUUID()); // Step 2: start query LOGGER.info("query ns status -> begin"); @@ -338,7 +344,7 @@ public class VfcManager { ValidateUtil.assertObjectNotNull(rsp); LOGGER.info("query ns progress response status is : {}", rsp.getStatus()); LOGGER.info("query ns progress response content is : {}", rsp.getResponseContent()); - //Step 3:check the response staus + // Step 3:check the response staus if(!HttpCode.isSucess(rsp.getStatus())) { LOGGER.info("fail to query job status"); nsOperInfo.setErrorCode(String.valueOf(rsp.getStatus())); diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsOperationKey.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsOperationKey.java index d6cfbde906..e4d6d66cda 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsOperationKey.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsOperationKey.java @@ -31,6 +31,16 @@ package org.openecomp.mso.adapters.vfc.model; public class NsOperationKey {
/**
+ * The subscriber id
+ */
+ private String globalSubscriberId;
+
+ /**
+ * The serviceType
+ */
+ private String serviceType;
+
+ /**
* The service ID
*/
private String serviceId;
@@ -45,6 +55,41 @@ public class NsOperationKey { */
private String nodeTemplateUUID;
+
+
+
+ /**
+ * @return Returns the globalSubscriberId.
+ */
+ public String getGlobalSubscriberId() {
+ return globalSubscriberId;
+ }
+
+
+ /**
+ * @param globalSubscriberId The globalSubscriberId to set.
+ */
+ public void setGlobalSubscriberId(String globalSubscriberId) {
+ this.globalSubscriberId = globalSubscriberId;
+ }
+
+ /**
+ * @return Returns the serviceType.
+ */
+ public String getServiceType() {
+ return serviceType;
+ }
+
+
+
+ /**
+ * @param serviceType The serviceType to set.
+ */
+ public void setServiceType(String serviceType) {
+ this.serviceType = serviceType;
+ }
+
+
/**
*
* <br>
|