diff options
author | Gao Weitao <victor.gao@huawei.com> | 2017-09-27 09:01:27 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2017-09-27 09:01:27 +0000 |
commit | 8e48f152f64b1fcb1f1c3e6e17add9079bf43da2 (patch) | |
tree | 9de8f6971901d822897f2cdc2d48c0967ca1b3a7 | |
parent | a1b77452f1a8281ec5ee5f5b83ea03a30df52fc6 (diff) | |
parent | 9341cde619d14842368b5b26cce1e41021a74683 (diff) |
Merge "Define constant instead of localhost"
4 files changed, 7 insertions, 5 deletions
diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java index 110d170b..24d6ed11 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/DownloadCsarManager.java @@ -212,6 +212,7 @@ public class DownloadCsarManager { zipFile.close(); } catch(IOException e) { LOG.error("IOException: " + e); + ; } } } diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java index 45e1c753..cc80b5ed 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/common/restclient/HttpBaseRest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016 Huawei Technologies Co., Ltd. + * Copyright 2016-2017 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. @@ -30,6 +30,7 @@ import org.eclipse.jetty.client.Address; import org.eclipse.jetty.client.HttpClient; import org.eclipse.jetty.client.HttpExchange; import org.eclipse.jetty.http.HttpMethods; +import org.onap.vfc.nfvo.vnfm.svnfm.vnfmadapter.service.constant.Constant; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -49,11 +50,9 @@ public abstract class HttpBaseRest implements Restful { protected HttpClient client = null; - private static final String LOCAL_HOST = "127.0.0.1"; - static final String HTTP_PATCH = "PATCH"; - String defaultIP = LOCAL_HOST; + String defaultIP = Constant.LOCAL_HOST; int defaultPort = -10000; diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java index 64e852e4..420d8eb0 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/adapter/impl/AdapterResourceManager.java @@ -395,7 +395,7 @@ public class AdapterResourceManager implements IResourceManager { JSONArray resArray = new JSONArray(); if(url == null || url.equals("")) { - url = "http://127.0.0.1:31943"; + url = "http://" + Constant.LOCAL_HOST + ":31943"; } // get vim_id diff --git a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java index 936be09c..3b1036e2 100644 --- a/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java +++ b/huawei/vnfmadapter/VnfmadapterService/service/src/main/java/org/onap/vfc/nfvo/vnfm/svnfm/vnfmadapter/service/constant/Constant.java @@ -156,6 +156,8 @@ public class Constant { public static final String USERNAME = "userName"; + public static final String LOCAL_HOST = "127.0.0.1"; + private Constant() { // private constructor } |