Package de.xima.fc.db
Class DatabaseMonitor
- java.lang.Object
-
- de.xima.fc.db.DatabaseMonitor
-
@Eager @ApplicationScoped @Deprecated(since="8.5.0", forRemoval=true) public class DatabaseMonitor extends Object
Deprecated, for removal: This API element is subject to removal in a future version.Monitors the database connection status.
-
-
Field Summary
Fields Modifier and Type Field Description static StringDB_HEALTHCHECK_NAMEDeprecated.
-
Constructor Summary
Constructors Constructor Description DatabaseMonitor()Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleancheck()Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the database connection is healthy, i.e. whether the database is reachable.static booleanisConnected()Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the last known status of the database connection is connected.static voidregisterConnectionEstablishedListener(IBaseNotificationListener listener)Deprecated, for removal: This API element is subject to removal in a future version.static voidregisterDisconnectedListener(IBaseNotificationListener listener)Deprecated, for removal: This API element is subject to removal in a future version.static voidregisterReconnectedListener(IBaseNotificationListener listener)Deprecated, for removal: This API element is subject to removal in a future version.static booleantestConnection()Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the database connection is healthy, i.e. whether the database is reachable.
-
-
-
Field Detail
-
DB_HEALTHCHECK_NAME
@Deprecated public static final String DB_HEALTHCHECK_NAME
Deprecated.
-
-
Method Detail
-
isConnected
public static boolean isConnected()
Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the last known status of the database connection is connected. A check is run in a fixed interval. UsetestConnection()to run a check now.- Returns:
trueif the database connection is connected,falseotherwise.
-
check
public boolean check()
Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the database connection is healthy, i.e. whether the database is reachable.- Returns:
trueif the database connection is healthy,falseotherwise.
-
testConnection
public static boolean testConnection()
Deprecated, for removal: This API element is subject to removal in a future version.Checks whether the database connection is healthy, i.e. whether the database is reachable. In contrast withisConnected(), this method actually performs a check and tries to reach the database, instead of returning the current status.- Returns:
trueif the database connection is healthy,falseotherwise.
-
registerConnectionEstablishedListener
public static void registerConnectionEstablishedListener(IBaseNotificationListener listener)
Deprecated, for removal: This API element is subject to removal in a future version.
-
registerDisconnectedListener
public static void registerDisconnectedListener(IBaseNotificationListener listener)
Deprecated, for removal: This API element is subject to removal in a future version.
-
registerReconnectedListener
public static void registerReconnectedListener(IBaseNotificationListener listener)
Deprecated, for removal: This API element is subject to removal in a future version.
-
-