Interface Datasource

All Known Implementing Classes:
JdbcDatasource, JndiDatasource

public interface Datasource
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.
  • Method Summary

    Modifier and Type
    Method
    Description
    getConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager)
    Uses the given link AtlassianBootstrapManager to acquire a Connection to the database defined by this Datasource.
    org.ofbiz.core.entity.config.DatasourceInfo
    getDatasource(String datasourceName, String fieldType, String schemaName)
    Get the equivalent Ofbiz DatasourceInfo config class for this Datasource.
    Provides the name of the datasource field that this datasource represents.
    getDescriptorValue(String databaseType)
    Provides a text description suitable for an administrator that identifies the datasource.
  • Method Details

    • getConnection

      Connection getConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) throws com.atlassian.config.bootstrap.BootstrapException
      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:
      com.atlassian.config.bootstrap.BootstrapException - if the connection cannot be established.
    • getDatasource

      org.ofbiz.core.entity.config.DatasourceInfo getDatasource(String datasourceName, String fieldType, 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.
      fieldType - 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.
    • getDescriptorValue

      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.
    • getDescriptorLabel

      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.