summaryrefslogtreecommitdiffstats
path: root/openecomp-be/api
diff options
context:
space:
mode:
authorsheetalm <sheetal.mudholkar@amdocs.com>2018-04-09 12:32:48 +0530
committerVitaly Emporopulo <Vitaliy.Emporopulo@amdocs.com>2018-04-09 12:11:18 +0000
commitd9d360318e1a4ae67958356d0fe3fb207f90fbf8 (patch)
tree44d8c2c77602c1ce27a407a11c6b723bec79f534 /openecomp-be/api
parent3d77b76b0cc27232886436018dafac462f3e8335 (diff)
Health check to work without user_id
healthcheck rest should work without the need for user_id in header For health check user "public" is used No need to fetch current session context to get tenant. So changing tenant to be "dox" Change-Id: Ie8296cde6245fe5e4b59a5c0b2052d06c878cb12 Issue-ID: SDC-1198 Signed-off-by: sheetalm <sheetal.mudholkar@amdocs.com>
Diffstat (limited to 'openecomp-be/api')
-rw-r--r--openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java15
1 files changed, 5 insertions, 10 deletions
diff --git a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java
index bb2d9ea565..04844b08b2 100644
--- a/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java
+++ b/openecomp-be/api/openecomp-sdc-rest-webapp/healthcheck-rest/healthcheck-rest-services/src/main/java/org/openecomp/sdcrests/health/rest/services/HealthCheckImpl.java
@@ -21,7 +21,6 @@
package org.openecomp.sdcrests.health.rest.services;
import org.apache.cxf.jaxrs.impl.ResponseBuilderImpl;
-import org.openecomp.sdc.common.session.SessionContext;
import org.openecomp.sdc.common.session.SessionContextProviderFactory;
import org.openecomp.sdc.health.HealthCheckManager;
import org.openecomp.sdc.health.HealthCheckManagerFactory;
@@ -58,21 +57,17 @@ public class HealthCheckImpl implements org.openecomp.sdcrests.health.rest.Healt
public Response checkHealth() {
HealthCheckResult healthCheckResult = new HealthCheckResult();
- SessionContext context =
- SessionContextProviderFactory.getInstance().createInterface().get();
-
- SessionContextProviderFactory.getInstance().createInterface().create("public",
- context.getTenant());
+ SessionContextProviderFactory.getInstance().createInterface().create("public", "dox");
try {
Collection<HealthInfo> healthInfos = healthCheckManager.checkHealth();
healthCheckResult.setComponentsInfo(healthInfos);
boolean someIsDown = healthInfos.stream()
.anyMatch(healthInfo -> healthInfo.getHealthCheckStatus().equals(HealthCheckStatus.DOWN));
- healthInfos.stream().
- filter(healthInfo -> healthInfo.getHealthCheckComponent()
- .equals(org.openecomp.sdc.health.data.MonitoredModules.BE)).
- findFirst()
+ healthInfos.stream()
+ .filter(healthInfo -> healthInfo.getHealthCheckComponent()
+ .equals(org.openecomp.sdc.health.data.MonitoredModules.BE))
+ .findFirst()
.ifPresent(healthInfo -> healthCheckResult.setSdcVersion(healthInfo.getVersion()));
if (someIsDown) {
Response.ResponseBuilder responseBuilder = new ResponseBuilderImpl();