Package org.nuxeo.ecm.core.storage
Class DBCheck
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.DBCheck
-
- All Implemented Interfaces:
BackingChecker
public class DBCheck extends Object implements BackingChecker
- Since:
- 9.2
- API Note:
- reworked in 11.5
-
-
Field Summary
Fields Modifier and Type Field Description protected static List<String>DB_EXCLUDE_CHECK_LISTprotected static StringPARAM_DB_DRIVERprotected static StringPARAM_DB_HOSTprotected static StringPARAM_DB_JDBC_URLprotected static StringPARAM_DB_NAMEprotected static StringPARAM_DB_PORTprotected static StringPARAM_DB_PWDprotected static StringPARAM_DB_USER
-
Constructor Summary
Constructors Constructor Description DBCheck()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanaccepts(ConfigurationHolder configHolder)Test if the check has to be done for the given configuration.voidcheck(ConfigurationHolder configHolder)Test the availability of the backing service.voidcheckDatabaseConnection(ConfigurationHolder configHolder)Check driver availability and database connectionprotected DriverlookupDriver(ConfigurationHolder configHolder, Path databaseTemplateDir, String classname)Builds anURLClassLoaderfor the given databaseTemplate looking in the templates directory and in the server lib directory, then looks for a driver-
Methods 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 Detail
-
PARAM_DB_DRIVER
protected static final String PARAM_DB_DRIVER
- See Also:
- Constant Field Values
-
PARAM_DB_JDBC_URL
protected static final String PARAM_DB_JDBC_URL
- See Also:
- Constant Field Values
-
PARAM_DB_HOST
protected static final String PARAM_DB_HOST
- See Also:
- Constant Field Values
-
PARAM_DB_PORT
protected static final String PARAM_DB_PORT
- See Also:
- Constant Field Values
-
PARAM_DB_NAME
protected static final String PARAM_DB_NAME
- See Also:
- Constant Field Values
-
PARAM_DB_USER
protected static final String PARAM_DB_USER
- See Also:
- Constant Field Values
-
PARAM_DB_PWD
protected static final String PARAM_DB_PWD
- See Also:
- Constant Field Values
-
-
Method Detail
-
accepts
public boolean accepts(ConfigurationHolder configHolder)
Description copied from interface:BackingCheckerTest if the check has to be done for the given configuration.- Specified by:
acceptsin interfaceBackingChecker- Parameters:
configHolder- The current configuration- Returns:
- true if
BackingChecker.check(ConfigurationHolder)has to be called.
-
check
public void check(ConfigurationHolder configHolder) throws ConfigurationException
Description copied from interface:BackingCheckerTest the availability of the backing service.- Specified by:
checkin 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 anURLClassLoaderfor 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
-
-