Package com.atlassian.confluence.setup
Class DefaultDatabaseVerifier
java.lang.Object
com.atlassian.confluence.setup.DefaultDatabaseVerifier
- All Implemented Interfaces:
DatabaseCollationVerifier
,DatabaseVerifier
- Since:
- 6.4
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
setBootstrapManager
(BootstrapManager bootstrapManager) verifyCollationOfDatabase
(Connection connection, String script, String[] supportedCollations, String doc) Validates the database collation for a given connection.void
verifyDatabase
(String databaseType, Connection connection) Validates the database connection by performing various checks according to the db type e.g., the collation and isolation level for MySQL.void
verifyDatabaseDetails
(String databaseType, com.atlassian.config.db.DatabaseDetails databaseDetails) Validates the given connection details by checking whether a connection can be returned, next checking the collation for MS SQL Server and MySQL.void
verifyDatasource
(String databaseType, String datasourceName) Validates the given datasource by checking whether a connection can be returned, next checking the collation for MS SQL Server and MySQL.
-
Constructor Details
-
DefaultDatabaseVerifier
public DefaultDatabaseVerifier()
-
-
Method Details
-
getBootstrapManager
-
setBootstrapManager
-
verifyDatabase
public void verifyDatabase(String databaseType, Connection connection) throws SQLException, DatabaseVerifyException Description copied from interface:DatabaseVerifier
Validates the database connection by performing various checks according to the db type e.g., the collation and isolation level for MySQL.- Specified by:
verifyDatabase
in interfaceDatabaseVerifier
- Parameters:
databaseType
- - the database type, such as mssql- Throws:
SQLException
- - indicates sql error occurs during the verificationDatabaseVerifyException
- - indicates the database was not configured properly.
-
verifyDatasource
public void verifyDatasource(String databaseType, String datasourceName) throws SQLException, DatabaseVerifyException Description copied from interface:DatabaseVerifier
Validates the given datasource by checking whether a connection can be returned, next checking the collation for MS SQL Server and MySQL.- Specified by:
verifyDatasource
in interfaceDatabaseVerifier
- Parameters:
databaseType
- - the database type, such as mssqldatasourceName
- - the JNDI datasource name input by customer at database setup stage- Throws:
SQLException
- - indicates the connection could not be created with the provided detailsDatabaseVerifyException
- - indicates the database was not configured successfully.
-
verifyDatabaseDetails
public void verifyDatabaseDetails(String databaseType, com.atlassian.config.db.DatabaseDetails databaseDetails) throws SQLException, DatabaseVerifyException Description copied from interface:DatabaseVerifier
Validates the given connection details by checking whether a connection can be returned, next checking the collation for MS SQL Server and MySQL.- Specified by:
verifyDatabaseDetails
in interfaceDatabaseVerifier
- Parameters:
databaseType
- - the database type, such as mssqldatabaseDetails
- - the connection details input by customer at database setup stage- Throws:
SQLException
- - indicates the connection could not be created with the provided detailsDatabaseVerifyException
- - indicates the database was not configured successfully using the provided details- See Also:
-
DatabaseDetails
-
verifyCollationOfDatabase
public Optional<DatabaseVerificationResult> verifyCollationOfDatabase(Connection connection, String script, String[] supportedCollations, String doc) throws SQLException Description copied from interface:DatabaseCollationVerifier
Validates the database collation for a given connection.- Specified by:
verifyCollationOfDatabase
in interfaceDatabaseCollationVerifier
- Parameters:
connection
- the database connection to validate against.script
- the script used to check the collation.supportedCollations
- collations which are supported for the given database.doc
- link to the Confluence document.- Returns:
- the verification result or empty if successful.
- Throws:
SQLException
- - indicates sql error occurs during the verification
-