package org.gluu.oxauth.ws.rs.controller;

import javax.enterprise.context.ApplicationScoped;
import javax.ws.rs.GET;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

/**
 * Health check controller
 * 
 * @author Yuriy Movchan
 * @version Jul 24, 2020
 */
@ApplicationScoped
@Path("/")
public class HealthCheckController {

    @GET
    @POST
    @Path("/health-check")
    @Produces(MediaType.APPLICATION_JSON)
	public String healthCheckController() {
        return "{\"status\":\"running\"}";
	}

}

@@ -87,16 +87,44 @@
 Scoped;%0A
+import javax.inject.Inject;%0A
 import j
@@ -139,16 +139,16 @@
 rs.GET;%0A
-
 import j
@@ -254,16 +254,66 @@
 aType;%0A%0A
+import org.gluu.persist.PersistenceEntryManager;%0A%0A
 /**%0A * H
@@ -461,16 +461,84 @@
 ller %7B%0A%0A
+%09@Inject%0A%09private PersistenceEntryManager persistenceEntryManager;%0A%0A
     @GET
@@ -658,16 +658,164 @@
 ler() %7B%0A
+    %09boolean isConnected = persistenceEntryManager.getOperationService().isConnected();%0A    %09String dbStatus = isConnected ? %22online%22 : %22offline%22; %0A
         
@@ -834,16 +834,17 @@
 tatus%5C%22:
+ 
 %5C%22runnin
@@ -846,16 +846,52 @@
 unning%5C%22
+, %5C%22db_status%5C%22:%5C%22%22 + dbStatus + %22%5C%22
 %7D%22;%0A%09%7D%0A%0A

Add db status to health check