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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the system database is currently connected and accessible.booleanCheck if the system database encryption settings are valid.booleanCheck if the system persistence layer is fully operational, meaning it is connected, up to date, and has valid encryption settings.booleanCheck if the system database schema is up to date with the latest migrations.booleanCheck if the system persistence layer is currently suspended, meaning it is intentionally taken offline for maintenance or other reasons.booleanTest the system database connection by performing a simple query or operation.booleanTest the system database encryption by attempting to read an encrypted value or perform an operation that requires valid encryption settings.booleanTest if the system persistence layer is fully operational by actively verifying the connection, schema, and encryption status.booleanTest 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
-
ENCRYPTION_HEALTHCHECK
-
SCHEMA_HEALTHCHECK
-
-
Method Details
-
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, whiletestConnectionStatus()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, whileisConnectionValid()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, whiletestSchemaStatus()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, whileisSchemaValid()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, whiletestEncryptionStatus()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, whileisEncryptionValid()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, whileisHealthy()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
-