com.atlassian.jira.config.database
Class DatabaseConfig

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

public final class DatabaseConfig
extends Object

The configuration for JIRA to connect to the database.

Since:
4.3

Field Summary
static String DEFAULT_DATASOURCE_NAME
          The name of the default JNDI datasource.
static String DEFAULT_DELEGATOR_NAME
          The name of the default delegator.
 
Constructor Summary
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)
           
 
Method Summary
 String getDatabaseType()
          Get the database type
 Datasource getDatasource()
          Get the datasource
 org.ofbiz.core.entity.config.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(com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager bootstrapManager)
           
 StartupCheck testConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager)
          Tests the connection using the given bootstrapManager.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_DATASOURCE_NAME

public static final String DEFAULT_DATASOURCE_NAME
The name of the default JNDI datasource. In single tenant mode, 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:
Constant Field Values

DEFAULT_DELEGATOR_NAME

public static final String DEFAULT_DELEGATOR_NAME
The name of the default delegator. In single tenant mode, 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:
Constant Field Values
Constructor Detail

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 Detail

testConnection

public StartupCheck 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.DefaultAtlassianBootstrapManager 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

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()


Copyright © 2002-2012 Atlassian. All Rights Reserved.