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 TypeMethodDescriptiongetConnection(com.atlassian.config.bootstrap.AtlassianBootstrapManager bootstrapManager) Uses the givenlink AtlassianBootstrapManagerto acquire aConnectionto the database defined by thisDatasource.org.ofbiz.core.entity.config.DatasourceInfogetDatasource(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 givenlink AtlassianBootstrapManagerto acquire aConnectionto the database defined by thisDatasource.- 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.xmlschemaName- the name of the schema for the database (may be empty)- Returns:
- an instance of a
DatasourceInfosuitable for configuring Ofbiz.
-
getDescriptorValue
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.
-