From e6dc14ab8c5a9ef72ed9e0ddc781ea3e11bf291e Mon Sep 17 00:00:00 2001 From: subhash kumar singh Date: Sat, 24 Nov 2018 19:06:49 +0530 Subject: Fix retrieval for SDNC endpoint Fix retrieval for SDNC endpoint. Change-Id: I51f79b61ab9194e3d45a71dac5ca5fe7c869cff4 Issue-ID: SO-689 Signed-off-by: subhash kumar singh --- .../workflow/serviceTask/AbstractSdncOperationTask.java | 11 ++++++++--- .../serviceTask/SdncServiceTopologyOperationTask.java | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java index 0a00a61f83..3108adaa53 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java @@ -289,9 +289,8 @@ public abstract class AbstractSdncOperationTask extends BaseTask { protected boolean isSend2SdncDirectly() { logger.info("AbstractSdncOperationTask.isSend2SdncDirectly begin!"); - String sdncIp = UrnPropertiesReader.getVariable("sdnc-ip"); - String sdncPort = UrnPropertiesReader.getVariable("sdnc-port"); - if (!StringUtils.isBlank(sdncIp) && isIp(sdncIp) && !StringUtils.isBlank(sdncPort)) { + String sdncHost = UrnPropertiesReader.getVariable("sdnc.host"); + if (!StringUtils.isBlank(sdncHost)) { logger.info("AbstractSdncOperationTask.isSend2SdncDirectly = true."); return true; } @@ -317,6 +316,12 @@ public abstract class AbstractSdncOperationTask extends BaseTask { return returnPort; } + protected String getSdncHost() { + String sdncHost = UrnPropertiesReader.getVariable("sdnc.host"); + logger.info("AbstractSdncOperationTask.getSdncPort: returnPort = {}", sdncHost); + return sdncHost; + } + private GenericResourceApi getGenericResourceApiClient() { logger.info("AbstractSdncOperationTask.getGenericResourceApiClient begin!"); String msbIp = System.getenv().get(ONAP_IP); diff --git a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java index 8e41d0d88e..dc625d35c3 100644 --- a/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java +++ b/bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java @@ -72,7 +72,7 @@ public class SdncServiceTopologyOperationTask extends AbstractSdncOperationTask private void send2SdncDirectly(String defaulAuth, RpcServiceTopologyOperationInputEntity inputEntity) throws RouteException { sdncLogger.info("SdncServiceTopologyOperationTask.send2SdncDirectly begin!"); - String url = "http://" + getSdncIp() + ":" + getSdncPort() + URL; + String url = getSdncHost() + URL; HttpPost httpPost = new HttpPost(url); httpPost.addHeader("Authorization", defaulAuth); httpPost.addHeader("Content-type", "application/json"); -- cgit 1.2.3-korg