Class DatabaseConfig
java.lang.Object
com.atlassian.jira.config.database.DatabaseConfig
The configuration for JIRA to connect to the database.
- Since:
- 4.3
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDatabaseConfig
(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) -
Method Summary
Modifier and TypeMethodDescriptionGet the database typeGet the datasourceorg.ofbiz.core.entity.config.DatasourceInfo
Get the name of the data source.Get the name of the delegate.Get the schema nameboolean
isDatabaseEmpty
(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) boolean
Returnstrue
if this configuration is for an embedded HSQL or H2 databaseboolean
isH2()
Returnstrue
if this configuration is for an H2 databaseboolean
isMySql()
Returnstrue
if this configuration is for any MySQL databaseboolean
isMySql8()
Returnstrue
if this configuration is for a MySQL 8.0 databaseboolean
isOracle()
Returnstrue
if this configuration is for an Oracle databaseboolean
Returnstrue
if this configuration is for a Postgres databaseboolean
Returnstrue
if this configuration is for a SqlServer databasetestConnection
(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) Tests the connection using the given bootstrapManager.toString()
-
Field Details
-
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
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
Uses defaults for OfBiz Datasource name and Delegator name.- Parameters:
databaseType
- the name that matches the field types defined in entityengine.xmlschemaName
- 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
Get the name of the data source. This is also known as the helperName in ofbiz.- Returns:
- The name of the data source
-
getDelegatorName
Get the name of the delegate.- Returns:
- The name of the delegate.
-
getDatabaseType
Get the database type- Returns:
- The database type
-
isH2
public boolean isH2()Returnstrue
if this configuration is for an H2 database- Returns:
true
if this configuration is for an H2 database
-
isMySql
public boolean isMySql()Returnstrue
if this configuration is for any MySQL database- Returns:
true
if this configuration is for any MySQL database
-
isMySql8
public boolean isMySql8()Returnstrue
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()Returnstrue
if this configuration is for an Oracle database- Returns:
true
if this configuration is for an Oracle database
-
isPostgres
public boolean isPostgres()Returnstrue
if this configuration is for a Postgres database- Returns:
true
if this configuration is for a Postgres database
-
isSqlServer
public boolean isSqlServer()Returnstrue
if this configuration is for a SqlServer database- Returns:
true
if this configuration is for a SqlServer database
-
isEmbeddedDatabase
public boolean isEmbeddedDatabase()Returnstrue
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
Get the schema name- Returns:
- The schema name
-
getDatasource
Get the datasource- Returns:
- The datasource
-
getDatasourceInfo
public org.ofbiz.core.entity.config.DatasourceInfo getDatasourceInfo() -
getDescriptorValue
-
getDescriptorLabel
-
toString
-