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.DatasourceInfoGet the name of the data source.Get the name of the delegate.Get the schema namebooleanisDatabaseEmpty(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) booleanReturnstrueif this configuration is for an embedded HSQL or H2 databasebooleanisH2()Returnstrueif this configuration is for an H2 databasebooleanisMySql()Returnstrueif this configuration is for any MySQL databasebooleanisMySql8()Returnstrueif this configuration is for a MySQL databasebooleanisOracle()Returnstrueif this configuration is for an Oracle databasebooleanReturnstrueif this configuration is for a Postgres databasebooleanReturnstrueif 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()Returnstrueif this configuration is for an H2 database- Returns:
trueif this configuration is for an H2 database
-
isMySql
public boolean isMySql()Returnstrueif this configuration is for any MySQL database- Returns:
trueif this configuration is for any MySQL database
-
isMySql8
public boolean isMySql8()Returnstrueif this configuration is for a MySQL database- Returns:
trueif this configuration is for a MySQL database
-
isOracle
public boolean isOracle()Returnstrueif this configuration is for an Oracle database- Returns:
trueif this configuration is for an Oracle database
-
isPostgres
public boolean isPostgres()Returnstrueif this configuration is for a Postgres database- Returns:
trueif this configuration is for a Postgres database
-
isSqlServer
public boolean isSqlServer()Returnstrueif this configuration is for a SqlServer database- Returns:
trueif this configuration is for a SqlServer database
-
isEmbeddedDatabase
public boolean isEmbeddedDatabase()Returnstrueif this configuration is for an embedded HSQL or H2 database- Returns:
trueif 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
-