From 52d456a9b3b553908e1d3b7dc0fc087b47142d7d Mon Sep 17 00:00:00 2001 From: "francesco.mangiacrapa" Date: Wed, 16 Oct 2024 17:13:41 +0200 Subject: [PATCH] updated --- .../application/geoportal/service/GeoPortalService.java | 2 ++ .../geoportal/service/rest/GeoportalHealthCheck.java | 7 +++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/GeoPortalService.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/GeoPortalService.java index 7d9466e..2cf04bd 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/GeoPortalService.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/GeoPortalService.java @@ -21,6 +21,7 @@ import org.gcube.application.geoportal.service.engine.providers.ucd.ProfileMap; import org.gcube.application.geoportal.service.engine.providers.ucd.SingleISResourceUCDProvider; import org.gcube.application.geoportal.service.engine.providers.ucd.UCDManager; import org.gcube.application.geoportal.service.model.internal.db.Mongo; +import org.gcube.application.geoportal.service.rest.GeoportalHealthCheck; import org.gcube.application.geoportal.service.rest.Plugins; import org.gcube.application.geoportal.service.rest.ProfiledDocuments; import org.gcube.application.geoportal.service.rest.UseCaseDescriptors; @@ -53,6 +54,7 @@ public class GeoPortalService extends ResourceConfig{ registerClasses(ProfiledDocuments.class); registerClasses(UseCaseDescriptors.class); registerClasses(Plugins.class); + registerClasses(GeoportalHealthCheck.class); //registerClasses(DocsGenerator.class); log.info("Setting implementations .. "); diff --git a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java index c8a5aed..3c8c5f2 100644 --- a/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java +++ b/geoportal-service/src/main/java/org/gcube/application/geoportal/service/rest/GeoportalHealthCheck.java @@ -21,14 +21,17 @@ import org.gcube.common.scope.api.ScopeProvider; import com.mongodb.client.MongoIterable; +import lombok.extern.slf4j.Slf4j; + @Path("/health") +@Slf4j public class GeoportalHealthCheck implements HealthCheck { @GET @Path("") @Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) public Response check() { - + log.info("Check called"); HealthCheckResponse hcr = call(); return Response.ok().entity(hcr).build(); } @@ -44,7 +47,7 @@ public class GeoportalHealthCheck implements HealthCheck { @Path("/mongo") @Produces({ MediaType.TEXT_HTML, MediaType.APPLICATION_JSON }) public Response checkDatabase(@QueryParam("context") String context) { - + log.info("checkDatabase called in the context {}", context); if (context == null) return Response.status(400).entity("'context' paramater (e.g. '/gcube/devsec/devVRE' is required").build();