From df0e90472a7edc1f10cc66d10f790306fde9cffa Mon Sep 17 00:00:00 2001 From: Zhuoyao Huang <10112215@zte.com.cn> Date: Mon, 23 Oct 2017 20:19:54 +0800 Subject: 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> --- .../workflow/serviceTask/AbstractSdncOperationTask.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'bpmn/MSOInfrastructureBPMN/src/main/java/org/openecomp') 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 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); -- cgit 1.2.3-korg