Class DefaultDatabaseVerifier

java.lang.Object
com.atlassian.confluence.setup.DefaultDatabaseVerifier
All Implemented Interfaces:
DatabaseCollationVerifier, DatabaseVerifier

@Internal public class DefaultDatabaseVerifier extends Object implements DatabaseVerifier
Since:
6.4
  • Constructor Details

    • DefaultDatabaseVerifier

      public DefaultDatabaseVerifier()
  • Method Details

    • getBootstrapManager

      public BootstrapManager getBootstrapManager()
    • setBootstrapManager

      public void setBootstrapManager(BootstrapManager bootstrapManager)
    • 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 interface DatabaseVerifier
      Parameters:
      databaseType - - the database type, such as mssql
      Throws:
      SQLException - - indicates sql error occurs during the verification
      DatabaseVerifyException - - 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 interface DatabaseVerifier
      Parameters:
      databaseType - - the database type, such as mssql
      datasourceName - - the JNDI datasource name input by customer at database setup stage
      Throws:
      SQLException - - indicates the connection could not be created with the provided details
      DatabaseVerifyException - - 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 interface DatabaseVerifier
      Parameters:
      databaseType - - the database type, such as mssql
      databaseDetails - - the connection details input by customer at database setup stage
      Throws:
      SQLException - - indicates the connection could not be created with the provided details
      DatabaseVerifyException - - 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 interface DatabaseCollationVerifier
      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