public interface

Datasource

com.atlassian.jira.config.database.Datasource
Known Indirect Subclasses

Class Overview

A datasource that JIRA can use to connect to a database. Abstraction above the JNDI or JDBC configuration details and the methods that rely on those details.

Summary

Public Methods
Connection getConnection(AtlassianBootstrapManager bootstrapManager)
Uses the given link AtlassianBootstrapManager to acquire a Connection to the database defined by this Datasource.
DatasourceInfo getDatasource(String datasourceName, String databaseType, String schemaName)
Get the equivalent Ofbiz DatasourceInfo config class for this Datasource.
String getDescriptorLabel()
Provides the name of the datasource field that this datasource represents.
String getDescriptorValue(String databaseType)
Provides a text description suitable for an administrator that identifies the datasource.

Public Methods

public Connection getConnection (AtlassianBootstrapManager bootstrapManager)

Uses the given link AtlassianBootstrapManager to acquire a Connection to the database defined by this Datasource.

Parameters
bootstrapManager the bootstrapManager to use to get the connection.
Returns
  • the connection.
Throws
BootstrapException if the connection cannot be established.

public DatasourceInfo getDatasource (String datasourceName, String databaseType, String schemaName)

Get the equivalent Ofbiz DatasourceInfo config class for this Datasource. This effectively translates between this datasource and the ofbiz entityengine.xml of yore.

Parameters
datasourceName the ofbiz name of the datasource.
databaseType the field-type for the datasource as defined in ofbiz field-types.xml
schemaName the name of the schema for the database (may be empty)
Returns
  • an instance of a DatasourceInfo suitable for configuring Ofbiz.

public String getDescriptorLabel ()

Provides the name of the datasource field that this datasource represents. Effectively, it delegates the name of the datasource field when the configuration is being described to an administrator and will say "JDBC Config" or "JNDI Name" as appropriate.

Returns
  • the label.

public String getDescriptorValue (String databaseType)

Provides a text description suitable for an administrator that identifies the datasource.

Parameters
databaseType the field-type for the datasource as defined in ofbiz field-types.xml
Returns
  • the description.