summaryrefslogtreecommitdiffstats
path: root/bpmn/MSOInfrastructureBPMN/src/main/java
diff options
context:
space:
mode:
authorZhuoyao Huang <10112215@zte.com.cn>2017-10-23 20:19:54 +0800
committerZhuoyao Huang <10112215@zte.com.cn>2017-10-23 20:19:54 +0800
commitdf0e90472a7edc1f10cc66d10f790306fde9cffa (patch)
treef051dd50d8acbb674ce4a68a56f509416b98a140 /bpmn/MSOInfrastructureBPMN/src/main/java
parent1b766d3cebe983b0a37003dddb9ce80efd0ddd68 (diff)
Get msb ip from ONAP_IP
which is an envirment parameter come from open_ip Change-Id: I3a314f65d92556bc1f9054ab837cbe15154c11d8 Issue-ID:SO-181 Signed-off-by: Zhuoyao Huang <10112215@zte.com.cn>
Diffstat (limited to 'bpmn/MSOInfrastructureBPMN/src/main/java')
-rw-r--r--bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
index 4495e87789..c52c3b2f14 100644
--- a/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
+++ b/bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp/mso/bpmn/infrastructure/workflow/serviceTask/AbstractSdncOperationTask.java
@@ -43,8 +43,9 @@ import java.util.Map;
public abstract class AbstractSdncOperationTask extends BaseTask {
private static final String DEFAULT_MSB_IP = "127.0.0.1";
- private static final int DEFAULT_MSB_Port = 10081;
+ private static final int DEFAULT_MSB_Port = 80;
private static final String SDCADAPTOR_INPUTS = "resourceParameters";
+ public static final String ONAP_IP = "ONAP_IP";
private RequestsDatabase requestsDB = RequestsDatabase.getInstance();
@@ -105,9 +106,15 @@ public abstract class AbstractSdncOperationTask extends BaseTask {
private GenericResourceApi getGenericResourceApiClient(DelegateExecution execution) {
updateProgress(execution, null, null, "20", "getGenericResourceApiClient begin!");
+ String msbIp = System.getenv().get(ONAP_IP);
+ int msbPort = DEFAULT_MSB_Port;
Map<String, String> properties = PropertyConfiguration.getInstance().getProperties("mso.bpmn.urn.properties");
- String msbIp = getString(properties, "msb.address", DEFAULT_MSB_IP);
- int msbPort = Integer.valueOf(getString(properties, "msb.port", String.valueOf(DEFAULT_MSB_Port)));
+ if (properties != null) {
+ if (StringUtils.isBlank(msbIp)) {
+ msbIp = getString(properties, "msb.address", DEFAULT_MSB_IP);
+ }
+ msbPort = Integer.valueOf(getString(properties, "msb.port", String.valueOf(DEFAULT_MSB_Port)));
+ }
MSBServiceClient msbClient = new MSBServiceClient(msbIp, msbPort);
RestServiceCreater restServiceCreater = new RestServiceCreater(msbClient);
return restServiceCreater.createService(GenericResourceApi.class);