java.lang.Object
org.gcube.informationsystem.resourceregistry.persistence.orientdb.health.DatabaseHealthCheck
All Implemented Interfaces:
org.gcube.common.health.api.HealthCheck

public class DatabaseHealthCheck extends Object implements org.gcube.common.health.api.HealthCheck
Readiness of the database: the service is down when the database does not answer, since no operation can run without it. The health report is public: its messages are fixed sentences, the details go to the log.
Author:
Luca Frosini (ISTI - CNR)
  • Field Details

    • NAME

      public static final String NAME
      The name of the check in the health report.
      See Also:
    • UNREACHABLE

      public static final String UNREACHABLE
      The reason given when the database does not answer.
      See Also:
    • DESCRIPTION

      public static final String DESCRIPTION
      What the check verifies, shown next to its name in the health report.
      See Also:
  • Constructor Details

    • DatabaseHealthCheck

      public DatabaseHealthCheck()
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface org.gcube.common.health.api.HealthCheck
    • getDescription

      public String getDescription()
      Specified by:
      getDescription in interface org.gcube.common.health.api.HealthCheck
    • check

      public org.gcube.common.health.api.response.HealthCheckResponse check()
      Runs a trivial query on a session of the pool.
      Specified by:
      check in interface org.gcube.common.health.api.HealthCheck
      Returns:
      up when the database answers, down with the reason otherwise