Change-Id: I2e7bcd48e04b7ec54573d3eb2dbb9b525e25c3b6
Issue-ID: HOLMES-81
Signed-off-by: Guangrong Fu <fu.guangrong@zte.com.cn>
//String info = getServiceAddrInfoFromCBS(MSB_ADDR);\r
String info = getServiceAddrInfoFromCBS(getEnv(HOSTNAME));\r
log.info("Got the service information of \"" + getEnv(HOSTNAME) + "\" from CBS. The response is " + info + ".");\r
//String info = getServiceAddrInfoFromCBS(MSB_ADDR);\r
String info = getServiceAddrInfoFromCBS(getEnv(HOSTNAME));\r
log.info("Got the service information of \"" + getEnv(HOSTNAME) + "\" from CBS. The response is " + info + ".");\r
- JSONObject infoObj = JSONObject.fromObject(info);\r
- info = infoObj.has("msb.hostname") ? infoObj.getString("msb.hostname") : null;\r
- msbServerInfo = split(info);\r
+ JSONObject infoObj = JSONObject.fromObject(info);\r
+ String msbInfoTmp = infoObj.has("msb.hostname") ? infoObj.getString("msb.hostname") : null;\r
+ if (msbInfoTmp != null) {\r
+ msbServerInfo = split(msbInfoTmp);\r
+ } else {\r
+ msbServerInfo = split(getEnv(MSB_ADDR));\r
+ }\r
} else {\r
msbServerInfo = split(getEnv(MSB_ADDR));\r
}\r
} else {\r
msbServerInfo = split(getEnv(MSB_ADDR));\r
}\r
try {
response = getDcaeResponse(serviceAddrInfo);
} catch (Exception e) {
try {
response = getDcaeResponse(serviceAddrInfo);
} catch (Exception e) {
- throw new CorrelationException("Failed to connect to dcae", e);
+ throw new CorrelationException("Failed to connect to DCAE. ", e);
}
DcaeConfigurations dcaeConfigurations = null;
dcaeConfigurations = DcaeConfigurationParser.parse(response);
}
DcaeConfigurations dcaeConfigurations = null;
dcaeConfigurations = DcaeConfigurationParser.parse(response);