Interface HealthCheck

All Known Implementing Classes:
AbstractHealthCheck, AttachmentDataFileStoreCheck, DatabaseCollationHealthCheck, DatabaseSetupHealthCheck, DbConnectionHealthCheck, FakeHealthCheck, HealthCheckTemplate, HomeHealthCheck, HttpThreadsVsDbConnectionsHealthCheck, LicenseValidationHealthCheck, MSSQLDriverMigrationHealthCheck, MySqlJdbcUrlHealthCheck, OperatingSystemFreeMemoryHealthCheck

public interface HealthCheck
A health check performed by Confluence during some phase (or phases) of its lifecycle. A check should:
  • Return an empty collection on success.
  • Return a non-empty collection otherwise, e.g. failure.
  • Throw an exception if called during not applicable phase
  • Check things that prevent startup or otherwise require attention from the administrator.
  • Not check things that Confluence can fix by itself (e.g. creating a needed directory).
  • Be short-running, because it is invoked synchronously.
  • Release any acquired resources before returning from its perform(LifecyclePhase) method.
  • Not have side-effects (e.g. logging its own messages or Johnson events).
Since:
6.6.0
  • Method Details

    • getId

      default String getId()
      Returns the unique ID of this check.
      Returns:
      a stable, unique, non-blank ID
    • getPrerequisites

      @NonNull Collection<HealthCheck> getPrerequisites()
      Returns the checks that must have a non-EventLevel.FATAL result before this check can be run.
      Returns:
      see above
    • perform

      @NonNull List<HealthCheckResult> perform(LifecyclePhase phase)
      Performs health check for given phase.

      If the health check passes, an empty list will be returned.

      Returns:
      a collection of HealthCheckResult
      Throws:
      UnsupportedOperationException - if not applicable phase is provided
    • isApplicableFor

      boolean isApplicableFor(LifecyclePhase phase)
      Checks if current HealthCheck is applicable for given phase
      Returns:
      true if HealthCheck is applicable for the phase