Class DatabaseConfig

java.lang.Object
com.atlassian.jira.config.database.DatabaseConfig

public class DatabaseConfig extends Object
The configuration for JIRA to connect to the database.
Since:
4.3
  • Field Details

    • DEFAULT_DATASOURCE_NAME

      public static final String DEFAULT_DATASOURCE_NAME
      The name of the default JNDI datasource. This is the one true place for this constant to live in JIRA. This should not be used by plugins or considered an API.
      See Also:
    • DEFAULT_DELEGATOR_NAME

      public static final String DEFAULT_DELEGATOR_NAME
      The name of the default delegator. There Is Only One. This is the one true place for this constant to live in JIRA. This should not be used by plugins or considered an API.
      See Also:
  • Constructor Details

    • DatabaseConfig

      public DatabaseConfig(String databaseType, String schemaName, Datasource datasource)
      Uses defaults for OfBiz Datasource name and Delegator name.
      Parameters:
      databaseType - the name that matches the field types defined in entityengine.xml
      schemaName - if the database needs it, the name of the schema. e.g. "public" is common in postgres.
      datasource - the definition of the jdbc or jndi details.
    • DatabaseConfig

      public DatabaseConfig(String datasourceName, String delegatorName, String databaseType, String schemaName, Datasource datasource)
  • Method Details

    • testConnection

      public FaultDescription testConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) throws com.atlassian.config.bootstrap.BootstrapException
      Tests the connection using the given bootstrapManager.
      Parameters:
      bootstrapManager - to use for testing the connection.
      Returns:
      any StartupCheck that has failed this test or null if all OK.
      Throws:
      com.atlassian.config.bootstrap.BootstrapException - on connection failure.
    • isDatabaseEmpty

      public boolean isDatabaseEmpty(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) throws com.atlassian.config.bootstrap.BootstrapException
      Throws:
      com.atlassian.config.bootstrap.BootstrapException
    • getDatasourceName

      public String getDatasourceName()
      Get the name of the data source. This is also known as the helperName in ofbiz.
      Returns:
      The name of the data source
    • getDelegatorName

      public String getDelegatorName()
      Get the name of the delegate.
      Returns:
      The name of the delegate.
    • getDatabaseType

      public String getDatabaseType()
      Get the database type
      Returns:
      The database type
    • isH2

      public boolean isH2()
      Returns true if this configuration is for an H2 database
      Returns:
      true if this configuration is for an H2 database
    • isMySql

      public boolean isMySql()
      Returns true if this configuration is for any MySQL database
      Returns:
      true if this configuration is for any MySQL database
    • isMySql8

      public boolean isMySql8()
      Returns true if this configuration is for a MySQL 8.0 database
      Returns:
      true if this configuration is for a MySQL 8.0 database
    • isOracle

      public boolean isOracle()
      Returns true if this configuration is for an Oracle database
      Returns:
      true if this configuration is for an Oracle database
    • isPostgres

      public boolean isPostgres()
      Returns true if this configuration is for a Postgres database
      Returns:
      true if this configuration is for a Postgres database
    • isSqlServer

      public boolean isSqlServer()
      Returns true if this configuration is for a SqlServer database
      Returns:
      true if this configuration is for a SqlServer database
    • isEmbeddedDatabase

      public boolean isEmbeddedDatabase()
      Returns true if this configuration is for an embedded HSQL or H2 database
      Returns:
      true if this configuration is for an embedded HSQL or H2 database
    • getSchemaName

      public String getSchemaName()
      Get the schema name
      Returns:
      The schema name
    • getDatasource

      public Datasource getDatasource()
      Get the datasource
      Returns:
      The datasource
    • getDatasourceInfo

      public org.ofbiz.core.entity.config.DatasourceInfo getDatasourceInfo()
    • getDescriptorValue

      public String getDescriptorValue()
    • getDescriptorLabel

      public String getDescriptorLabel()
    • toString

      public String toString()
      Overrides:
      toString in class Object