public final class

DatabaseConfig

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

Class Overview

The configuration for JIRA to connect to the database.

Summary

Constants
String DEFAULT_DATASOURCE_NAME The name of the default JNDI datasource.
String DEFAULT_DELEGATOR_NAME The name of the default delegator.
Public Constructors
DatabaseConfig(String databaseType, String schemaName, Datasource datasource)
Uses defaults for OfBiz Datasource name and Delegator name.
DatabaseConfig(String datasourceName, String delegatorName, String databaseType, String schemaName, Datasource datasource)
Public Methods
String getDatabaseType()
Get the database type
Datasource getDatasource()
Get the datasource
DatasourceInfo getDatasourceInfo()
String getDatasourceName()
Get the name of the data source.
String getDelegatorName()
Get the name of the delegate.
String getDescriptorLabel()
String getDescriptorValue()
String getSchemaName()
Get the schema name
boolean isDatabaseEmpty(DefaultAtlassianBootstrapManager bootstrapManager)
boolean isHSql()
Returns true if this configuration is for an HSql database
boolean isMySql()
Returns true if this configuration is for a MySQL database
boolean isOracle()
Returns true if this configuration is for an Oracle database
boolean isPostgres()
Returns true if this configuration is for a Postgres database
boolean isSqlServer()
Returns true if this configuration is for a SqlServer database
StartupCheck testConnection(AtlassianBootstrapManager bootstrapManager)
Tests the connection using the given bootstrapManager.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Constants

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.

Constant Value: "defaultDS"

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.

Constant Value: "default"

Public Constructors

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.

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

Public Methods

public String getDatabaseType ()

Get the database type

Returns
  • The database type

public Datasource getDatasource ()

Get the datasource

Returns
  • The datasource

public DatasourceInfo getDatasourceInfo ()

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

public String getDelegatorName ()

Get the name of the delegate.

Returns
  • The name of the delegate.

public String getDescriptorLabel ()

public String getDescriptorValue ()

public String getSchemaName ()

Get the schema name

Returns
  • The schema name

public boolean isDatabaseEmpty (DefaultAtlassianBootstrapManager bootstrapManager)

Throws
BootstrapException

public boolean isHSql ()

Returns true if this configuration is for an HSql database

Returns
  • true if this configuration is for an HSql database

public boolean isMySql ()

Returns true if this configuration is for a MySQL database

Returns
  • true if this configuration is for a MySQL database

public boolean isOracle ()

Returns true if this configuration is for an Oracle database

Returns
  • true if this configuration is for an Oracle database

public boolean isPostgres ()

Returns true if this configuration is for a Postgres database

Returns
  • true if this configuration is for a Postgres database

public boolean isSqlServer ()

Returns true if this configuration is for a SqlServer database

Returns
  • true if this configuration is for a SqlServer database

public StartupCheck testConnection (AtlassianBootstrapManager bootstrapManager)

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
BootstrapException on connection failure.

public String toString ()