diff options
author | Murali <murali.p@huawei.com> | 2017-09-06 13:53:22 +0000 |
---|---|---|
committer | Murali <murali.p@huawei.com> | 2017-09-06 13:53:22 +0000 |
commit | 6056c8e731a910abe233c6cc2cd7d69364355c2a (patch) | |
tree | ed5957659a1671f6f38fb42a70dc20f5d47bfb08 /vnfmarket-be | |
parent | dc0f780ca00a51a3f8ef337a12cb9676842af5f9 (diff) |
Remove the use of open-o library
Change-Id: Ib55f9ce65c4312cb1672aaf0f25f6bfc1d5d9a21
Jira:VNFSDK-34
Signed-off-by: Murali <murali.p@huawei.com>
Diffstat (limited to 'vnfmarket-be')
4 files changed, 36 insertions, 131 deletions
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 @@ <parent> <groupId>org.onap.oparent</groupId> <artifactId>oparent</artifactId> - <version>1.0.0-SNAPSHOT</version> - <relativePath>../oparent</relativePath> + <version>1.0.0-SNAPSHOT</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>org.onap.vnfsdk.refrepo</groupId> 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 @@ <maven.test.failure.ignore>false</maven.test.failure.ignore> </properties> - <repositories> - <repository> - <id>open-o</id> - <name>OPEN-O repository</name> - <url>https://nexus.open-o.org/content/repositories/public/</url> - </repository> - </repositories> + <dependencies> <dependency> @@ -57,11 +51,7 @@ <artifactId>log4j</artifactId> <version>1.2.16</version> </dependency> - <dependency> - <groupId>org.openo.common-services.common-utilities</groupId> - <artifactId>commonlib-cbb</artifactId> - <version>2.0.0</version> - </dependency> + <dependency> <groupId>io.dropwizard</groupId> <artifactId>dropwizard-core</artifactId> @@ -108,12 +98,7 @@ <groupId>org.apache.httpcomponents</groupId> <artifactId>httpmime</artifactId> <version>4.5.2</version> - </dependency> - <dependency> - <groupId>org.openo.common-services.common-utilities</groupId> - <artifactId>commonlib-restclient</artifactId> - <version>2.0.0</version> - </dependency> + </dependency> <!-- consumer --> <dependency> <groupId>com.eclipsesource.jaxrs</groupId> @@ -179,6 +164,32 @@ <version>1.8.2</version> <scope>test</scope> </dependency> + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-jaxrs</artifactId> + <version>1.9.2</version> + </dependency> + <dependency> + <groupId>org.codehaus.jackson</groupId> + <artifactId>jackson-mapper-asl</artifactId> + <version>1.9.2</version> + </dependency> + <dependency> + <groupId>net.sf.json-lib</groupId> + <artifactId>json-lib</artifactId> + <version>2.4</version> + <classifier>jdk15</classifier> + </dependency> + <dependency> + <groupId>org.apache.commons</groupId> + <artifactId>commons-io</artifactId> + <version>1.3.2</version> + </dependency> + <dependency> + <groupId>commons-io</groupId> + <artifactId>commons-io</artifactId> + <version>2.4</version> + </dependency> <!-- UT end --> </dependencies> <profiles> 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<String, String> paramsMap, String params,Map<String, String> 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<String, String> headerMap = new HashMap<String, String>(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<String, String> 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; - } -} |