Interface SystemPersistenceHealthProvider


public interface SystemPersistenceHealthProvider
Interface for providing health status of the system persistence layer. This interface defines methods to check the connection status, schema validity, and encryption settings of the system database, as well as overall health and suspension status. Implementations of this interface can provide cached values for quick checks, while also offering methods for active verification of each aspect of the system persistence health.
Since:
8.5.0
Author:
Michael Kohlsche
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
    static final String
     
  • Method Summary

    Modifier and Type
    Method
    Description
     
    boolean
    Check if the system database is currently connected and accessible.
    boolean
    Check if the system database encryption settings are valid.
    boolean
    Check if the system persistence layer is fully operational, meaning it is connected, up to date, and has valid encryption settings.
    boolean
    Check if the system database schema is up to date with the latest migrations.
    boolean
    Check if the system persistence layer is currently suspended, meaning it is intentionally taken offline for maintenance or other reasons.
    boolean
    Test the system database connection by performing a simple query or operation.
    boolean
    Test the system database encryption by attempting to read an encrypted value or perform an operation that requires valid encryption settings.
    boolean
    Test if the system persistence layer is fully operational by actively verifying the connection, schema, and encryption status.
    boolean
    Test the system database schema if any pending migrations need to be applied or if the schema is in an inconsistent state.
  • Field Details

    • CONNECTION_HEALTHCHECK

      static final String CONNECTION_HEALTHCHECK
    • ENCRYPTION_HEALTHCHECK

      static final String ENCRYPTION_HEALTHCHECK
    • SCHEMA_HEALTHCHECK

      static final String SCHEMA_HEALTHCHECK
  • Method Details

    • getInstance

      static SystemPersistenceHealthProvider getInstance()
    • isConnectionValid

      boolean isConnectionValid()
      Check if the system database is currently connected and accessible. This method may return a cached value and should be used for quick checks, while testConnectionStatus() should be used for active verification.
      Returns:
      true if the system database is connected, false otherwise
    • testConnectionStatus

      boolean testConnectionStatus()
      Test the system database connection by performing a simple query or operation. This method should be used to actively verify the connection status, while isConnectionValid() may return a cached value.
      Returns:
      true if the test operation succeeds, false otherwise
    • isSchemaValid

      boolean isSchemaValid()
      Check if the system database schema is up to date with the latest migrations. This method may return a cached value and should be used for quick checks, while testSchemaStatus() should be used for active verification.
      Returns:
      true if the system database schema is up to date, false otherwise
    • testSchemaStatus

      boolean testSchemaStatus()
      Test the system database schema if any pending migrations need to be applied or if the schema is in an inconsistent state. This method should perform an active check to verify that the database schema is up to date with the latest migrations, while isSchemaValid() may return a cached value.
      Returns:
      true if the schema is valid, false otherwise
    • isEncryptionValid

      boolean isEncryptionValid()
      Check if the system database encryption settings are valid. This method may return a cached value and should be used for quick checks, while testEncryptionStatus() should be used for active verification.
      Returns:
      true if the system database encryption settings are valid, false otherwise
    • testEncryptionStatus

      boolean testEncryptionStatus()
      Test the system database encryption by attempting to read an encrypted value or perform an operation that requires valid encryption settings. This method should be used to actively verify that the encryption settings are correct and data can be decrypted successfully, while isEncryptionValid() may return a cached value.
      Returns:
      true if the encryption test operation succeeds, false otherwise
    • isHealthy

      boolean isHealthy()
      Check if the system persistence layer is fully operational, meaning it is connected, up to date, and has valid encryption settings. This method may return a cached value and should be used for quick checks, while the individual test methods should be used for active verification of each aspect.
      Returns:
      true if the system persistence layer is fully operational, false otherwise
    • testHealth

      boolean testHealth()
      Test if the system persistence layer is fully operational by actively verifying the connection, schema, and encryption status. This method should perform active checks for all aspects of the system database health, while isHealthy() may return a cached value.
      Returns:
      true if the system persistence layer is fully operational, false otherwise
    • isSuspended

      boolean isSuspended()
      Check if the system persistence layer is currently suspended, meaning it is intentionally taken offline for maintenance or other reasons. A suspended persistence layer may not be accessible or operational, but this state is expected and does not necessarily indicate a problem.
      Returns:
      true if the system persistence layer is suspended, false otherwise