summaryrefslogtreecommitdiffstats
path: root/adapters/mso-vfc-adapter/src
diff options
context:
space:
mode:
Diffstat (limited to 'adapters/mso-vfc-adapter/src')
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiUtil.java (renamed from adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiAdapter.java)2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/VfcManager.java8
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/CommonConstant.java17
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/DriverExceptionID.java6
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/HttpCode.java4
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/LocationConstraint.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsInstantiateReq.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsProgressStatus.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/RestfulResponse.java12
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java12
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java2
-rw-r--r--adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java6
-rw-r--r--adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java4
15 files changed, 38 insertions, 45 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiAdapter.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiUtil.java
index 6e3eb93126..89c100d084 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiAdapter.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/AaiUtil.java
@@ -30,7 +30,7 @@ import org.openecomp.mso.adapters.vfc.model.RestfulResponse;
* @author
* @version ONAP Amsterdam Release 2017-08-28
*/
-public class AaiAdapter {
+public class AaiUtil {
public static RestfulResponse addRelation(String serviceInstanceID, String resourceInstanceID)
{
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 221448cb7b..afea05c2bb 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
@@ -114,7 +114,7 @@ public class VfcManager {
LOGGER.info("create ns -> end");
LOGGER.info("save segment and operaton info -> begin");
// Step 5: add relation between service and NS
- AaiAdapter.addRelation(segInput.getNsOperationKey().getServiceId(), nsInstanceId);
+ AaiUtil.addRelation(segInput.getNsOperationKey().getServiceId(), nsInstanceId);
// Step 6: save resource operation information
ResourceOperationStatus nsOperInfo = RequestsDatabase.getResourceOperationStatus(
@@ -168,7 +168,7 @@ public class VfcManager {
}
// Step3: remove relation info between service and ns
- AaiAdapter.removeRelation(nsOperationKey.getServiceId(), nsInstanceId);
+ AaiUtil.removeRelation(nsOperationKey.getServiceId(), nsInstanceId);
LOGGER.info("delete segment information -> end");
// Step4: update service segment operation status
@@ -322,6 +322,7 @@ public class VfcManager {
public RestfulResponse getNsProgress(NsOperationKey nsOperationKey, String jobId) {
ValidateUtil.assertObjectNotNull(jobId);
+ // Step 1: query the current resource operation status
ResourceOperationStatus nsOperInfo = RequestsDatabase.getResourceOperationStatus(nsOperationKey.getServiceId(),
nsOperationKey.getOperationId(), nsOperationKey.getNodeTemplateId());
@@ -334,6 +335,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
if(!HttpCode.isSucess(rsp.getStatus())) {
LOGGER.info("fail to query job status");
nsOperInfo.setErrorCode(String.valueOf(rsp.getStatus()));
@@ -370,7 +372,7 @@ public class VfcManager {
RequestsDatabase.updateResOperStatus(nsOperInfo);
throw new ApplicationException(HttpCode.INTERNAL_SERVER_ERROR, DriverExceptionID.JOB_STATUS_ERROR);
} else {
- // do nothing
+ LOGGER.error("unexcepted response status");
}
LOGGER.info("query ns status -> end");
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/CommonConstant.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/CommonConstant.java
index c2a9a685c9..b2fc4457a0 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/CommonConstant.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/CommonConstant.java
@@ -32,18 +32,6 @@ public class CommonConstant {
public static final String STR_EMPTY = "";
- public static final String CATALOGUE_QUERY_SVC_TMPL_NODETYPE_URL = "/openoapi/catalog/v1/servicetemplates/nesting";
-
- public static final String SDNO_CREATE_URL = "/openoapi/sdnonslcm/v1/ns";
-
- public static final String SDNO_INSTANTIATE_URL = "/openoapi/sdnonslcm/v1/ns/%s/instantiate";
-
- public static final String SDNO_TERMINATE_URL = "/openoapi/sdnonslcm/v1/ns/%s/terminate";
-
- public static final String SDNO_DELETE_URL = "/openoapi/sdnonslcm/v1/ns/%s";
-
- public static final String SDNO_QUERY_URL = "/openoapi/sdnonslcm/v1/jobs/%s";
-
public static final String NFVO_CREATE_URL = "/openoapi/nslcm/v1/ns";
public static final String NFVO_INSTANTIATE_URL = "/openoapi/nslcm/v1/ns/%s/instantiate";
@@ -54,11 +42,6 @@ public class CommonConstant {
public static final String NFVO_QUERY_URL = "/openoapi/nslcm/v1/jobs/%s";
- public static final String GSO_CREATE_URL = "/openoapi/gso/v1/services";
-
- public static final String GSO_DELETE_URL = "/openoapi/gso/v1/services/%s";
-
- public static final String GSO_QUERY_URL = "/openoapi/gso/v1/services/%s/operations/%s";
public static final String LEFT_QUOTE_LEFT_BRACE = "\"\\{";
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/DriverExceptionID.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/DriverExceptionID.java
index 5df1a9f684..652de97f5f 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/DriverExceptionID.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/DriverExceptionID.java
@@ -26,7 +26,7 @@ package org.openecomp.mso.adapters.vfc.constant;
* identification of adapter exception
*
* @author
- * @version GSO 0.5 2016/9/3
+ * @version ONAP Amsterdam Release 2017-9-6
*/
public class DriverExceptionID {
@@ -45,14 +45,10 @@ public class DriverExceptionID {
public static final String FAIL_TO_CREATE_NS = "Fail to create ns";
- public static final String FAIL_TO_CREATE_GSO_NS = "Fail to create gso ns";
-
public static final String INVALID_RESPONSEE_FROM_DELETE_OPERATION = "Invalid response from delete operation";
public static final String INVALID_RESPONSE_FROM_TERMINATE_OPERATION = "Invalid response from terminate operation";
- public static final String FAIL_TO_DELETE_GSO_NS = "Fail to delete gso ns";
-
public static final String FAIL_TO_DELETE_NS = "Fail to delete ns";
public static final String FAIL_TO_TERMINATE_NS = "Fail to terminate ns";
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/HttpCode.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/HttpCode.java
index b9bb78689d..0eda7bd33b 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/HttpCode.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/constant/HttpCode.java
@@ -72,7 +72,7 @@ public class HttpCode {
* <p>
* </p>
*
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
private HttpCode() {
@@ -83,7 +83,7 @@ public class HttpCode {
*
* @param httpCode response code
* @return true or false
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public static boolean isSucess(int httpCode) {
return httpCode / 100 == 2;
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java
index 831eaab3d3..6a78d2e73e 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/exceptions/ApplicationException.java
@@ -37,7 +37,7 @@ public class ApplicationException extends WebApplicationException {
*
* @param errorCode error status
* @param errorDetail error detail
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public ApplicationException(int errorCode, Object errorDetail) {
super(Response.status(errorCode).entity(errorDetail).type(MediaType.APPLICATION_JSON).build());
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/LocationConstraint.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/LocationConstraint.java
index b03145db20..8b259e915b 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/LocationConstraint.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/LocationConstraint.java
@@ -27,7 +27,7 @@ import java.util.Map;
* </p>
*
* @author
- * @version GSO 0.5 2017/2/21
+ * @version ONAP Amsterdam Release 2017-9-6
*/
public class LocationConstraint {
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsInstantiateReq.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsInstantiateReq.java
index 6c1d209399..7e8a9ce0c3 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsInstantiateReq.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsInstantiateReq.java
@@ -26,7 +26,7 @@ package org.openecomp.mso.adapters.vfc.model;
* request model for instatiate
*
* @author
- * @version GSO 0.5 2016/9/3
+ * @version ONAP Amsterdam Release 2017-9-6
*/
public class NsInstantiateReq extends NsParameters {
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java
index ecb77cf762..79d770ba4d 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsParameters.java
@@ -28,7 +28,7 @@ import java.util.Map;
* </p>
*
* @author
- * @version GSO 0.5 2017/2/21
+ * @version ONAP Amsterdam Release 2017-9-6
*/
public class NsParameters {
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsProgressStatus.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsProgressStatus.java
index 414c1f19b8..d68da47ed7 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsProgressStatus.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/NsProgressStatus.java
@@ -28,7 +28,7 @@ import java.util.List;
* response model of query operation status
*
* @author
- * @version GSO 0.5 2016/9/3
+ * @version ONAP Amsterdam Release 2017-9-6
*/
public class NsProgressStatus {
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/RestfulResponse.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/RestfulResponse.java
index 510f61305c..483c952a97 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/RestfulResponse.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/model/RestfulResponse.java
@@ -21,12 +21,24 @@ package org.openecomp.mso.adapters.vfc.model;
import java.util.Map;
+/**
+ * The Unified Restful Reponse Class
+ * <br>
+ * <p>
+ * </p>
+ *
+ * @author
+ * @version ONAP Amsterdam Release 2017-09-06
+ */
public class RestfulResponse {
+ // the response content
private String responseContent;
+ //the response status
private int status;
+ //the response header
private Map<String, String> respHeaderMap;
public RestfulResponse() {
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java
index 579c607f5b..34beb02c13 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/JsonUtil.java
@@ -36,7 +36,7 @@ import org.openecomp.mso.logger.MsoLogger;
* </p>
*
* @author
- * @version GSO 0.5 2016/9/1
+ * @version ONAP Amsterdam Release 2017-9-6
*/
public class JsonUtil {
@@ -61,7 +61,7 @@ public class JsonUtil {
* <p>
* </p>
*
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
private JsonUtil() {
@@ -73,7 +73,7 @@ public class JsonUtil {
* @param jsonstr json string.
* @param type that convert json string to
* @return model object
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public static <T> T unMarshal(String jsonstr, Class<T> type) {
try {
@@ -90,7 +90,7 @@ public class JsonUtil {
* @param jsonstr json string.
* @param type that convert json string to
* @return model object
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public static <T> T unMarshal(String jsonstr, TypeReference<T> type) {
try {
@@ -106,7 +106,7 @@ public class JsonUtil {
*
* @param srcObj data object
* @return json string
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public static String marshal(Object srcObj) {
try {
@@ -121,7 +121,7 @@ public class JsonUtil {
* Get mapper.<br/>
*
* @return mapper
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public static ObjectMapper getMapper() {
return MAPPER;
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
index 95025afd10..19cbca80e3 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/RestfulUtil.java
@@ -53,7 +53,7 @@ import org.openecomp.mso.logger.MsoLogger;
* utility to invoke restclient
*
* @author
- * @version GSO 0.5 2016/9/3
+ * @version ONAP Amsterdam Release 2017-9-6
*/
public class RestfulUtil {
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java
index 1d8549c892..37228c805c 100644
--- a/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java
+++ b/adapters/mso-vfc-adapter/src/main/java/org/openecomp/mso/adapters/vfc/util/ValidateUtil.java
@@ -36,7 +36,7 @@ public class ValidateUtil {
* <p>
* </p>
*
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
private ValidateUtil() {
@@ -47,7 +47,7 @@ public class ValidateUtil {
*
* @param paramValue parameter data
* @param name of parameter
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public static void assertStringNotNull(String paramValue, String paramName) {
if(null != paramValue && !paramValue.isEmpty()) {
@@ -62,7 +62,7 @@ public class ValidateUtil {
* Assert object is null.<br/>
*
* @param object data object
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
public static void assertObjectNotNull(Object object) {
if(null == object) {
diff --git a/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
index 3b43a15e50..46ab134bce 100644
--- a/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
+++ b/adapters/mso-vfc-adapter/src/test/java/org/openecomp/mso/adapters/vfc/VfcAdapterTest.java
@@ -108,7 +108,7 @@ public class VfcAdapterTest {
* Mock to get request body.<br/>
*
* @param file json file path.
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
private void mockGetRequestBody(final String file) {
new MockUp<RestfulUtil>() {
@@ -126,7 +126,7 @@ public class VfcAdapterTest {
* @param file the path of file
* @return json string
* @throws IOException when fail to read
- * @since GSO 0.5
+ * @since ONAP Amsterdam Release 2017-9-6
*/
private String getJsonString(final String file) {
if(ValidateUtil.isStrEmpty(file)) {