public final class

JndiDatasource

extends Object
implements Datasource
java.lang.Object
   ↳ com.atlassian.jira.config.database.JndiDatasource

Class Overview

A JNDI datasource

Summary

Public Constructors
JndiDatasource(String jndiName)
JndiDatasource(JndiDatasourceInfo jndi)
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.
String getJndiName()
Get the JNDI name
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.jira.config.database.Datasource

Public Constructors

public JndiDatasource (String jndiName)

public JndiDatasource (JndiDatasourceInfo jndi)

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

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.

public String getJndiName ()

Get the JNDI name

Returns
  • The JNDI name