@Internal public class DefaultDatabaseVerifier extends Object implements DatabaseVerifier
| Constructor and Description |
|---|
DefaultDatabaseVerifier() |
| Modifier and Type | Method and Description |
|---|---|
BootstrapManager |
getBootstrapManager() |
void |
setBootstrapManager(BootstrapManager bootstrapManager) |
Optional<DatabaseVerificationResult> |
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.
|
public BootstrapManager getBootstrapManager()
public void setBootstrapManager(BootstrapManager bootstrapManager)
public void verifyDatabase(String databaseType, Connection connection) throws SQLException, DatabaseVerifyException
DatabaseVerifierverifyDatabase in interface DatabaseVerifierdatabaseType - - the database type, such as mssqlSQLException - - indicates sql error occurs during the verificationDatabaseVerifyException - - indicates the database was not configured properly.public void verifyDatasource(String databaseType, String datasourceName) throws SQLException, DatabaseVerifyException
DatabaseVerifierverifyDatasource in interface DatabaseVerifierdatabaseType - - the database type, such as mssqldatasourceName - - the JNDI datasource name input by customer at database setup stageSQLException - - indicates the connection could not be created with the provided detailsDatabaseVerifyException - - indicates the database was not configured successfully.public void verifyDatabaseDetails(String databaseType, com.atlassian.config.db.DatabaseDetails databaseDetails) throws SQLException, DatabaseVerifyException
DatabaseVerifierverifyDatabaseDetails in interface DatabaseVerifierdatabaseType - - the database type, such as mssqldatabaseDetails - - the connection details input by customer at database setup stageSQLException - - indicates the connection could not be created with the provided detailsDatabaseVerifyException - - indicates the database was not configured successfully using the provided detailsDatabaseDetailspublic Optional<DatabaseVerificationResult> verifyCollationOfDatabase(Connection connection, String script, String[] supportedCollations, String doc) throws SQLException
DatabaseCollationVerifierverifyCollationOfDatabase in interface DatabaseCollationVerifierconnection - 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.SQLException - - indicates sql error occurs during the verificationCopyright © 2003–2021 Atlassian. All rights reserved.