org.pentaho.platform.engine.services.connection.datasource.dbcp
Class BaseDatasourceService

java.lang.Object
  extended by org.pentaho.platform.engine.services.connection.datasource.dbcp.BaseDatasourceService
All Implemented Interfaces:
IDatasourceService
Direct Known Subclasses:
JndiDatasourceService, NonPooledDatasourceService, NonPooledOrJndiDatasourceService, PooledDatasourceService, PooledOrJndiDatasourceService

public abstract class BaseDatasourceService
extends Object
implements IDatasourceService


Field Summary
 
Fields inherited from interface org.pentaho.platform.api.data.IDatasourceService
IDATASOURCE_SERVICE, JDBC_DATASOURCE, JDBC_POOL
 
Constructor Summary
BaseDatasourceService()
           
 
Method Summary
 void clearCache()
          This method clears the JNDI DS cache.
 void clearDataSource(String dsName)
          This method clears the JNDI DS cache.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pentaho.platform.api.data.IDatasourceService
getDataSource
 

Constructor Detail

BaseDatasourceService

public BaseDatasourceService()
Method Detail

clearCache

public 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.

Specified by:
clearCache in interface IDatasourceService

clearDataSource

public 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.

Specified by:
clearDataSource in interface IDatasourceService

getDSBoundName

public 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.

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

getDSUnboundName

public 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.

Specified by:
getDSUnboundName in interface IDatasourceService
Parameters:
dsName - The Datasource name (like "jdbc/SampleData")
Returns:
The unbound DS name (like "SampleData")