Remove the use of open-o library 79/10579/1
authorMurali <murali.p@huawei.com>
Wed, 6 Sep 2017 13:53:22 +0000 (13:53 +0000)
committerMurali <murali.p@huawei.com>
Wed, 6 Sep 2017 13:53:22 +0000 (13:53 +0000)
Change-Id: Ib55f9ce65c4312cb1672aaf0f25f6bfc1d5d9a21
Jira:VNFSDK-34
Signed-off-by: Murali <murali.p@huawei.com>
pom.xml
vnfmarket-be/pom.xml
vnfmarket-be/vnf-sdk-marketplace/pom.xml
vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/onboarding/hooks/functiontest/FunctionTestExceutor.java
vnfmarket-be/vnf-sdk-marketplace/src/main/java/org/onap/vnfsdk/marketplace/rest/RestfulUtil.java [deleted file]

diff --git a/pom.xml b/pom.xml
index 643906e..967b0ae 100644 (file)
--- a/pom.xml
+++ b/pom.xml
@@ -20,8 +20,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>
index 4e4f9eb..8cc4786 100644 (file)
@@ -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>
index faba3ea..ae9f62e 100644 (file)
                <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>
                        <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>
                        <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>
                        <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>
index bbe2cf3..17422c4 100644 (file)
@@ -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 (file)
index 5dc8e33..0000000
+++ /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;
-    }
-}