org.pentaho.platform.api.data
Interface IDatasourceService

All Known Implementing Classes:
AbstractTenantAwareDatasourceService, BaseDatasourceService, JndiDatasourceService, NonPooledDatasourceService, NonPooledOrJndiDatasourceService, PooledDatasourceService, PooledOrJndiDatasourceService, TenantAwareLoginParsingDatasourceService, TenantAwareSessionVariableDatasourceService

public interface IDatasourceService

This interface defines Pentaho's DatasourceService API

Author:
Ramaiz Mansoor (rmansoor@pentaho.org)

Field Summary
static String IDATASOURCE_SERVICE
           
static String JDBC_DATASOURCE
           
static String JDBC_POOL
           
 
Method Summary
 void clearCache()
          This method clears the JNDI DS cache.
 void clearDataSource(String dsName)
          This method clears the JNDI DS cache.
 DataSource getDataSource(String dsName)
          Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource.
 String getDSBoundName(String dsName)
          Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource.
 String getDSUnboundName(String dsName)
          Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource.
 

Field Detail

JDBC_POOL

static final String JDBC_POOL
See Also:
Constant Field Values

JDBC_DATASOURCE

static final String JDBC_DATASOURCE
See Also:
Constant Field Values

IDATASOURCE_SERVICE

static final String IDATASOURCE_SERVICE
See Also:
Constant Field Values
Method Detail

clearCache

void clearCache()
This method clears the JNDI DS cache. The need exists because after a JNDI connection edit the old DS must be removed from the cache.


clearDataSource

void clearDataSource(String dsName)
This method clears the JNDI DS cache. The need exists because after a JNDI connection edit the old DS must be removed from the cache.


getDataSource

DataSource getDataSource(String dsName)
                         throws DatasourceServiceException
Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource. This method is intended to hide all the lookups that may be required to find a jndi name.

Parameters:
dsName - The Datasource name
Returns:
DataSource if there is one bound in JNDI
Throws:
NamingException
DatasourceServiceException

getDSBoundName

String getDSBoundName(String dsName)
                      throws DatasourceServiceException
Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource. This method is intended to hide all the lookups that may be required to find a jndi name, and return the actual bound name.

Parameters:
dsName - The Datasource name (like SampleData)
Returns:
The bound DS name if it is bound in JNDI (like "jdbc/SampleData")
Throws:
NamingException
DatasourceServiceException

getDSUnboundName

String getDSUnboundName(String dsName)
Since JNDI is supported different ways in different app servers, it's nearly impossible to have a ubiquitous way to look up a datasource. This method is intended to extract just the regular name of a specified JNDI source.

Parameters:
dsName - The Datasource name (like "jdbc/SampleData")
Returns:
The unbound DS name (like "SampleData")