From 6056c8e731a910abe233c6cc2cd7d69364355c2a Mon Sep 17 00:00:00 2001 From: Murali Date: Wed, 6 Sep 2017 13:53:22 +0000 Subject: Remove the use of open-o library Change-Id: Ib55f9ce65c4312cb1672aaf0f25f6bfc1d5d9a21 Jira:VNFSDK-34 Signed-off-by: Murali --- pom.xml | 3 +- vnfmarket-be/pom.xml | 3 +- vnfmarket-be/vnf-sdk-marketplace/pom.xml | 47 ++++++---- .../hooks/functiontest/FunctionTestExceutor.java | 13 ++- .../onap/vnfsdk/marketplace/rest/RestfulUtil.java | 104 --------------------- 5 files changed, 37 insertions(+), 133 deletions(-) delete mode 100644 vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/rest/RestfulUtil.java diff --git a/pom.xml b/pom.xml index 643906ef..967b0aea 100644 --- a/pom.xml +++ b/pom.xml @@ -20,8 +20,7 @@ org.onap.oparent oparent - 1.0.0-SNAPSHOT - ../oparent + 1.0.0-SNAPSHOT 4.0.0 diff --git a/vnfmarket-be/pom.xml b/vnfmarket-be/pom.xml index 4e4f9eb6..8cc4786c 100644 --- a/vnfmarket-be/pom.xml +++ b/vnfmarket-be/pom.xml @@ -18,8 +18,7 @@ org.onap.oparent oparent - 1.0.0-SNAPSHOT - ../oparent + 1.0.0-SNAPSHOT 4.0.0 org.onap.vnfsdk.refrepo diff --git a/vnfmarket-be/vnf-sdk-marketplace/pom.xml b/vnfmarket-be/vnf-sdk-marketplace/pom.xml index faba3ead..ae9f62ee 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/pom.xml +++ b/vnfmarket-be/vnf-sdk-marketplace/pom.xml @@ -28,13 +28,7 @@ false - - - open-o - OPEN-O repository - https://nexus.open-o.org/content/repositories/public/ - - + @@ -57,11 +51,7 @@ log4j 1.2.16 - - org.openo.common-services.common-utilities - commonlib-cbb - 2.0.0 - + io.dropwizard dropwizard-core @@ -108,12 +98,7 @@ org.apache.httpcomponents httpmime 4.5.2 - - - org.openo.common-services.common-utilities - commonlib-restclient - 2.0.0 - + com.eclipsesource.jaxrs @@ -179,6 +164,32 @@ 1.8.2 test + + org.codehaus.jackson + jackson-jaxrs + 1.9.2 + + + org.codehaus.jackson + jackson-mapper-asl + 1.9.2 + + + net.sf.json-lib + json-lib + 2.4 + jdk15 + + + org.apache.commons + commons-io + 1.3.2 + + + commons-io + commons-io + 2.4 + diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutor.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutor.java index bbe2cf34..17422c44 100644 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutor.java +++ b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutor.java @@ -34,8 +34,7 @@ import org.onap.vnfsdk.marketplace.onboarding.entity.OnBoradingRequest; import org.onap.vnfsdk.marketplace.rest.RestConstant; import org.onap.vnfsdk.marketplace.rest.RestResponse; import org.onap.vnfsdk.marketplace.rest.RestfulClient; -import org.onap.vnfsdk.marketplace.rest.RestfulUtil; -import org.openo.baseservice.roa.util.restclient.RestfulResponse; + import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -167,7 +166,7 @@ public class FunctionTestExceutor paramsMap.put(CommonConstant.HttpContext.URL, CommonConstant.functionTest.FUNCTEST_RESULT_URL + key); paramsMap.put(CommonConstant.HttpContext.METHOD_TYPE, CommonConstant.MethodType.GET); - RestfulResponse response = RestfulUtil.sendRestRequest(paramsMap, null, null); + /*RestfulResponse response = RestfulUtil.sendRestRequest(paramsMap, null, null); if(!checkValidRestResponse(response)) { logger.error("Respone for getTestResultsByFuncTestKeyMsb is not valid !!!"); @@ -181,8 +180,8 @@ public class FunctionTestExceutor else { logger.info("NULL Function Test Results via MSB for Key:" + key); - } - return response.getResponseContent(); + } */ + return null; } /** @@ -200,14 +199,14 @@ public class FunctionTestExceutor return true; } - private static boolean checkValidRestResponse(RestfulResponse rsp) + /*private static boolean checkValidRestResponse(RestfulResponse rsp) { if ((rsp == null) || (RestConstant.RESPONSE_CODE_200 != rsp.getStatus() && RestConstant.RESPONSE_CODE_201 != rsp.getStatus())) { return false; } return true; - } + }*/ @SuppressWarnings("deprecation") private static HttpEntity buildRequest(InputStream inputStream) diff --git a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/rest/RestfulUtil.java b/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/rest/RestfulUtil.java deleted file mode 100644 index 5dc8e333..00000000 --- a/vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/rest/RestfulUtil.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2016 Huawei Technologies Co., Ltd. - * - * 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. - */ - -package org.onap.vnfsdk.marketplace.rest; - -import java.util.HashMap; -import java.util.Map; - -import org.openo.baseservice.remoteservice.exception.ServiceException; -import org.openo.baseservice.roa.util.restclient.Restful; -import org.openo.baseservice.roa.util.restclient.RestfulFactory; -import org.openo.baseservice.roa.util.restclient.RestfulParametes; -import org.openo.baseservice.roa.util.restclient.RestfulResponse; - -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; - -public class RestfulUtil { - - private static final Logger LOGGER = LoggerFactory.getLogger(RestfulUtil.class); - - private RestfulUtil() { - } - - /** - * Interface for Sending Request via REST - * @param paramsMap - * @param params - * @param queryParam - * @return - */ - public static RestfulResponse sendRestRequest(Map paramsMap, String params,Map queryParam) - { - if(null == paramsMap) - { - LOGGER.error("sendRestResponse : Input validation failed !"); - return null; - } - - String url = paramsMap.get(RestConstant.HttpContext.URL); - String methodType = paramsMap.get(RestConstant.HttpContext.METHOD_TYPE); - - RestfulResponse rsp = null; - Restful rest = RestfulFactory.getRestInstance(RestfulFactory.PROTO_HTTP); - - try - { - RestfulParametes restfulParametes = new RestfulParametes(); - Map headerMap = new HashMap(3); - headerMap.put(RestConstant.HttpContext.CONTENT_TYPE, RestConstant.HttpContext.MEDIA_TYPE_JSON); - restfulParametes.setHeaderMap(headerMap); - - if(null != params) - { - restfulParametes.setRawData(params); - } - - if(null != queryParam) - { - for(Map.Entry curEntity : queryParam.entrySet()) - { - restfulParametes.putHttpContextHeader(curEntity.getKey(), curEntity.getValue()); - } - } - if(rest != null) - { - if(RestConstant.MethodType.GET.equalsIgnoreCase(methodType)) - { - rsp = rest.get(url, restfulParametes, null); - } - else if(RestConstant.MethodType.POST.equalsIgnoreCase(methodType)) - { - rsp = rest.post(url, restfulParametes, null); - } - else if(RestConstant.MethodType.PUT.equalsIgnoreCase(methodType)) - { - rsp = rest.put(url, restfulParametes, null); - } - else if(RestConstant.MethodType.DELETE.equalsIgnoreCase(methodType)) - { - rsp = rest.delete(url, restfulParametes, null); - } - } - } - catch(ServiceException e) - { - LOGGER.error("sendRestResponse, get restful response catch exception {}", e); - } - return rsp; - } -} -- cgit 1.2.3-korg