com.atlassian.jira.config.database
Class JndiDatasource

java.lang.Object
  extended by com.atlassian.jira.config.database.JndiDatasource
All Implemented Interfaces:
Datasource

public final class JndiDatasource
extends Object
implements Datasource

A JNDI datasource


Constructor Summary
JndiDatasource(org.ofbiz.core.entity.config.JndiDatasourceInfo jndi)
           
JndiDatasource(String jndiName)
           
 
Method Summary
 Connection 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 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JndiDatasource

public JndiDatasource(String jndiName)

JndiDatasource

public JndiDatasource(org.ofbiz.core.entity.config.JndiDatasourceInfo jndi)
Method Detail

getJndiName

public String getJndiName()
Get the JNDI name

Returns:
The JNDI name

getConnection

public Connection getConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager)
                         throws com.atlassian.config.bootstrap.BootstrapException
Description copied from interface: Datasource
Uses the given link AtlassianBootstrapManager to acquire a Connection to the database defined by this Datasource.

Specified by:
getConnection in interface 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

public org.ofbiz.core.entity.config.DatasourceInfo getDatasource(String datasourceName,
                                                                 String databaseType,
                                                                 String schemaName)
Description copied from interface: Datasource
Get the equivalent Ofbiz DatasourceInfo config class for this Datasource. This effectively translates between this datasource and the ofbiz entityengine.xml of yore.

Specified by:
getDatasource in interface Datasource
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.

getDescriptorValue

public String getDescriptorValue(String databaseType)
Description copied from interface: Datasource
Provides a text description suitable for an administrator that identifies the datasource.

Specified by:
getDescriptorValue in interface Datasource
Parameters:
databaseType - the field-type for the datasource as defined in ofbiz field-types.xml
Returns:
the description.

getDescriptorLabel

public String getDescriptorLabel()
Description copied from interface: Datasource
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.

Specified by:
getDescriptorLabel in interface Datasource
Returns:
the label.


Copyright © 2002-2013 Atlassian. All Rights Reserved.