diff options
author | Yulian Han <elaine.hanyulian@huawei.com> | 2018-11-24 16:53:35 +0800 |
---|---|---|
committer | Yulian Han <elaine.hanyulian@huawei.com> | 2018-11-24 16:53:35 +0800 |
commit | 12c81872093919e10734abacf06d24e5e1df3a2c (patch) | |
tree | 4f0c0dc13ef24ee7b3999ad441d820bf1387a28a /adapters/mso-vfc-adapter/src/main/java/org | |
parent | 01e8d25e3f0cb7b8f7e118761dff403be4e54502 (diff) |
use config value instead hard code of url
Change-Id: Idaa55084f5ecb0dd3636c232cebc14fa5f064411
Issue-ID: SO-1249
Signed-off-by: Yulian Han <elaine.hanyulian@huawei.com>
Diffstat (limited to 'adapters/mso-vfc-adapter/src/main/java/org')
-rw-r--r-- | adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java index 0536dd3560..f6bf8b9fbf 100644 --- a/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java +++ b/adapters/mso-vfc-adapter/src/main/java/org/onap/so/adapters/vfc/util/RestfulUtil.java @@ -82,15 +82,18 @@ public class RestfulUtil { private Environment env; public String getMsbHost() { - // MSB_IP will be set as ONAP_IP environment parameter in install flow. - String msbIp = System.getenv().get(ONAP_IP); - // if ONAP IP is not set. get it from config file. - if(null == msbIp || msbIp.isEmpty()) { - msbIp = env.getProperty("mso.msb-ip", DEFAULT_MSB_IP); - } + // MSB_IP will be set as ONAP_IP environment parameter in install flow. + String msbIp = System.getenv().get(ONAP_IP); + // if ONAP IP is not set. get it from config file. + if (null == msbIp || msbIp.isEmpty()) { + msbIp = env.getProperty("mso.msb-ip", DEFAULT_MSB_IP); + } Integer msbPort = env.getProperty("mso.msb-port", Integer.class, DEFAULT_MSB_PORT); - return UriBuilder.fromPath("").host(msbIp).port(msbPort).scheme("http").build().toString(); + String msbEndpoint = UriBuilder.fromPath("").host(msbIp).port(msbPort).scheme("http").build().toString(); + LOGGER.debug("msbEndpoint in vfc adapter: " + msbEndpoint); + + return msbEndpoint; } private RestfulUtil() { @@ -99,7 +102,7 @@ public class RestfulUtil { public RestfulResponse send(String url, String methodType, String content) { String msbUrl = getMsbHost() + url; - LOGGER.info(MessageEnum.RA_NS_EXC, "Begin to sent message " + methodType +": " + msbUrl, "org.onap.so.adapters.vfc.util.RestfulUtil",VFC_ADAPTER); + LOGGER.debug("Begin to sent message " + methodType +": " + msbUrl); HttpRequestBase method = null; HttpResponse httpResponse = null; |