Package org.nuxeo.ecm.core.storage
Class DBCheck
java.lang.Object
org.nuxeo.ecm.core.storage.DBCheck
- All Implemented Interfaces:
BackingChecker
- Since:
- 9.2
- API Note:
- reworked in 11.5
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
accepts
(ConfigurationHolder configHolder) Test if the check has to be done for the given configuration.void
check
(ConfigurationHolder configHolder) Test the availability of the backing service.void
checkDatabaseConnection
(ConfigurationHolder configHolder) Check driver availability and database connectionprotected Driver
lookupDriver
(ConfigurationHolder configHolder, Path databaseTemplateDir, String classname) Builds anURLClassLoader
for the given databaseTemplate looking in the templates directory and in the server lib directory, then looks for a driverMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.nuxeo.launcher.config.backingservices.BackingChecker
getDescriptor, getDescriptor, getDescriptor, getDescriptor
-
Field Details
-
DB_EXCLUDE_CHECK_LIST
-
PARAM_DB_DRIVER
- See Also:
-
PARAM_DB_JDBC_URL
- See Also:
-
PARAM_DB_HOST
- See Also:
-
PARAM_DB_PORT
- See Also:
-
PARAM_DB_NAME
- See Also:
-
PARAM_DB_USER
- See Also:
-
PARAM_DB_PWD
- See Also:
-
-
Constructor Details
-
DBCheck
public DBCheck()
-
-
Method Details
-
accepts
Description copied from interface:BackingChecker
Test if the check has to be done for the given configuration.- Specified by:
accepts
in interfaceBackingChecker
- Parameters:
configHolder
- The current configuration- Returns:
- true if
BackingChecker.check(ConfigurationHolder)
has to be called.
-
check
Description copied from interface:BackingChecker
Test the availability of the backing service.- Specified by:
check
in interfaceBackingChecker
- Parameters:
configHolder
- The current configuration- Throws:
ConfigurationException
- if backing service is not available.
-
checkDatabaseConnection
public void checkDatabaseConnection(ConfigurationHolder configHolder) throws ConfigurationException, DatabaseDriverException, SQLException Check driver availability and database connection -
lookupDriver
protected Driver lookupDriver(ConfigurationHolder configHolder, Path databaseTemplateDir, String classname) throws DatabaseDriverException Builds anURLClassLoader
for the given databaseTemplate looking in the templates directory and in the server lib directory, then looks for a driver- Parameters:
classname
- Driver class name, defined byPARAM_DB_DRIVER
- Returns:
- Driver driver if found, else an Exception must have been raised.
- Throws:
DatabaseDriverException
- If there was an error when trying to instantiate the driver.- Since:
- 5.6
-