aboutsummaryrefslogtreecommitdiffstats
path: root/bpmn/so-bpmn-infrastructure-common
diff options
context:
space:
mode:
authorsubhash kumar singh <subhash.kumar.singh@huawei.com>2018-11-24 19:06:49 +0530
committersubhash kumar singh <subhash.kumar.singh@huawei.com>2018-11-24 19:06:49 +0530
commite6dc14ab8c5a9ef72ed9e0ddc781ea3e11bf291e (patch)
tree72d945d523c54b6363e927788258500a7d44d476 /bpmn/so-bpmn-infrastructure-common
parent03fafee16950784d30f1cc2e9c4afd7e971973f4 (diff)
Fix retrieval for SDNC endpoint
Fix retrieval for SDNC endpoint. Change-Id: I51f79b61ab9194e3d45a71dac5ca5fe7c869cff4 Issue-ID: SO-689 Signed-off-by: subhash kumar singh <subhash.kumar.singh@huawei.com>
Diffstat (limited to 'bpmn/so-bpmn-infrastructure-common')
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java11
-rw-r--r--bpmn/so-bpmn-infrastructure-common/src/main/java/org/onap/so/bpmn/infrastructure/workflow/serviceTask/SdncServiceTopologyOperationTask.java2
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");