summaryrefslogtreecommitdiffstats
path: root/status-control/src/main/java/org/openecomp/mso
diff options
context:
space:
mode:
authorxg353y <xg353y@intl.att.com>2017-04-11 13:30:42 +0200
committerxg353y <xg353y@intl.att.com>2017-04-11 15:34:19 +0200
commitb6b7bef8bdcad15af01ac88a038dd763ce59f68f (patch)
tree399d39da23aaa37701e487df064e3e0c27709ef3 /status-control/src/main/java/org/openecomp/mso
parent19340cad94eeaa1b580f7c0c99531de499e8ca14 (diff)
[MSO-8] Update the maven dependency
Update the maven depenency for sdc-distribution-client to cooperate with the sdc changes. Change-Id: I2da936e5c40cb68c7181bb78307192dd5655b5dc Signed-off-by: xg353y <xg353y@intl.att.com>
Diffstat (limited to 'status-control/src/main/java/org/openecomp/mso')
-rw-r--r--status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java25
1 files changed, 18 insertions, 7 deletions
diff --git a/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java b/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
index 03e807ae5a..e0e712cd48 100644
--- a/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
+++ b/status-control/src/main/java/org/openecomp/mso/HealthCheckUtils.java
@@ -7,9 +7,9 @@
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -59,11 +59,13 @@ public class HealthCheckUtils {
.entity (NOT_FOUND)
.build ();
- public enum NodeType {APIH, RA};
+ public enum NodeType {APIH, RA, BPMN};
public boolean catalogDBCheck (MsoLogger subMsoLogger, long startTime) {
- try (CatalogDatabase catalogDB = new CatalogDatabase ()) {
+ try {
+ CatalogDatabase catalogDB = new CatalogDatabase ();
catalogDB.healthCheck ();
+ catalogDB.close();
} catch (Exception e) {
subMsoLogger.error(MessageEnum.GENERAL_EXCEPTION, "", "HealthCheck", MsoLogger.ErrorCode.DataError, "Failed to check catalog database", e);
subMsoLogger.recordAuditEvent (startTime, MsoLogger.StatusCode.ERROR, MsoLogger.ResponseCode.DBAccessError, "Exception during healthcheck");
@@ -129,12 +131,14 @@ public class HealthCheckUtils {
if (null != requestId) {
finalUrl = finalUrl + "?requestId=" + requestId;
}
- try (CloseableHttpClient client = getHttpClient()) {
+ try {
HttpResponse response;
+ CloseableHttpClient client = getHttpClient ();
HttpGet get = new HttpGet(finalUrl);
msoLogger.debug("Get url is: " + finalUrl);
response = client.execute(get);
msoLogger.debug("Get response is: " + response);
+ client.close (); //shut down the connection
if (response.getStatusLine().getStatusCode() == HttpStatus.SC_OK) {
msoLogger.debug("verifyLocalHealth - Successfully communicate with APIH/BPMN/RA");
return true;
@@ -206,6 +210,13 @@ public class HealthCheckUtils {
return false;
}
apis = apiList.split(",");
+ } else if (NodeType.BPMN.equals (type)){
+ String apiList = topologyProp.getProperty("camunda-healthcheck-urn", null);
+ if (null == apiList) {
+ msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, "Not able to get jra-healthcheck-urn parameter", "", "HealthCheck", MsoLogger.ErrorCode.DataError, "Not able to get jra-healthcheck-urn parameter");
+ return false;
+ }
+ apis = apiList.split(",");
} else {
msoLogger.error (MessageEnum.GENERAL_EXCEPTION_ARG, "Unknown NodeType:" + type, "", "HealthCheck", MsoLogger.ErrorCode.DataError, "Unknown NodeType:" + type);
return false;
@@ -236,7 +247,7 @@ public class HealthCheckUtils {
String apihLB = topologyProp.getProperty("apih-load-balancer", null);
String apihApi = topologyProp.getProperty("apih-nodehealthcheck-urn", null);
String bpmnLB= topologyProp.getProperty("camunda-load-balancer", null);
- String bpmnApi = topologyProp.getProperty("camunda-healthcheck-urn", null);
+ String bpmnApi = topologyProp.getProperty("camunda-nodehealthcheck-urn", null);
String jraLB = topologyProp.getProperty("jra-load-balancer", null);
String jraApi = topologyProp.getProperty("jra-nodehealthcheck-urn", null);
@@ -285,4 +296,4 @@ public class HealthCheckUtils {
return "http://" + ip + ":" + port + url;
}
}
-}
+} \ No newline at end of file