diff options
author | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-09-18 02:22:37 -0400 |
---|---|---|
committer | Bonkur, Venkat (vb8416) <vb8416@att.com> | 2019-09-18 02:26:01 -0400 |
commit | 1ad915ff0a4678d6a5f918f39ea42c18b620f7bb (patch) | |
tree | 11228f1bd5f37b50db3d2018329a5f6ed28dfd4c /asdc-controller/src/main/java/org/onap | |
parent | e288bedf6a7b83c6127cbb1bc4281084cdbc218e (diff) |
Add SO Update Check if SDC activities deployment end point server Up for custom worlflows
Make changes to verify if SDC activities deployment
end point(mso.asdc.config.activity.endpoint) server up
for custom workflows
Issue-ID: SO-2348
Signed-off-by: Bonkur, Venkat (vb8416) <vb8416@att.com>
Change-Id: I3b90b6d8e95681a685b23dfaa2f65596532e5b0e
Diffstat (limited to 'asdc-controller/src/main/java/org/onap')
-rw-r--r-- | asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java index 7f1c1968c1..d60c377730 100644 --- a/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java +++ b/asdc-controller/src/main/java/org/onap/so/asdc/activity/DeployActivitySpecs.java @@ -65,7 +65,7 @@ public class DeployActivitySpecs { logger.warn("The hostname for SDC activities deployment is not configured in SO"); return; } - if (!checkHttpOk(hostname)) { + if (!checkHttpServerUp(hostname)) { logger.warn("The sdc end point is not alive"); return; } @@ -144,21 +144,22 @@ public class DeployActivitySpecs { return; } - public boolean checkHttpOk(String host) { + public boolean checkHttpServerUp(String host) { URL url = null; - boolean isOk = false; + boolean isUp = false; int responseCode = 0; try { url = new URL(host); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); + connection.setConnectTimeout(5000); responseCode = connection.getResponseCode(); } catch (Exception e) { logger.warn("Exception on connecting to SDC WFD endpoint: " + e.getMessage()); } - if (responseCode == HttpStatus.SC_OK) { - isOk = true; + if (responseCode == HttpStatus.SC_OK || responseCode == HttpStatus.SC_NOT_FOUND) { + isUp = true; } - return isOk; + return isUp; } } |