Class BaseDatasourceService

    • Field Summary

      • Fields inherited from interface org.pentaho.platform.api.data.IDBDatasourceService

        ACCESS_TO_UNDERLYING_CONNECTION_ALLOWED, DEFAULT_AUTO_COMMIT, DEFAULT_CATALOG, DEFAULT_READ_ONLY, DEFAULT_TRANSACTION_ISOLATION, IDBDATASOURCE_SERVICE, INITIAL_SIZE, JDBC_DATASOURCE, JDBC_POOL, LOG_ABANDONED, MAX_ACTIVE_KEY, MAX_IDLE_KEY, MAX_OPEN_PREPARED_STATEMENTS, MAX_WAIT_KEY, MIN_IDLE_KEY, POOL_PREPARED_STATEMENTS, QUERY_KEY, REMOVE_ABANDONED, REMOVE_ABANDONED_TIMEOUT, TEST_ON_BORROW, TEST_ON_RETURN, TEST_WHILE_IDLE, TIME_BETWEEN_EVICTION_RUNS_MILLIS, TRANSACTION_ISOLATION_NONE_VALUE
    • 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 org.pentaho.platform.api.data.IDBDatasourceService
      • 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 org.pentaho.platform.api.data.IDBDatasourceService
      • getDataSource

        public DataSource getDataSource​(String dsName)
                                 throws org.pentaho.platform.api.data.DBDatasourceServiceException
        Specified by:
        getDataSource in interface org.pentaho.platform.api.data.IDBDatasourceService
        Throws:
        org.pentaho.platform.api.data.DBDatasourceServiceException
      • retrieve

        protected DataSource retrieve​(String name)
                               throws org.pentaho.platform.api.data.DBDatasourceServiceException
        This should have been abstract, but changes to this API at a point release is not advised.
        Parameters:
        name - name of JNDI reference
        Returns:
        DataSource
        Throws:
        org.pentaho.platform.api.data.DBDatasourceServiceException
      • resolveDatabaseConnection

        protected DataSource resolveDatabaseConnection​(org.pentaho.database.model.IDatabaseConnection databaseConnection)
                                                throws org.pentaho.platform.api.data.DBDatasourceServiceException
        This should have been abstract, but changes to this API at a point release is not advised.
        Parameters:
        databaseConnection -
        Returns:
        Throws:
        org.pentaho.platform.api.data.DBDatasourceServiceException
      • getJndiDataSource

        protected DataSource getJndiDataSource​(String dsName)
                                        throws org.pentaho.platform.api.data.DBDatasourceServiceException
        Throws:
        org.pentaho.platform.api.data.DBDatasourceServiceException
      • getDSBoundName

        public String getDSBoundName​(String dsName)
                              throws org.pentaho.platform.api.data.DBDatasourceServiceException
        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 org.pentaho.platform.api.data.IDBDatasourceService
        Parameters:
        dsName - The Datasource name (like SampleData)
        Returns:
        The bound DS name if it is bound in JNDI (like "jdbc/SampleData")
        Throws:
        org.pentaho.platform.api.data.DBDatasourceServiceException
      • 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 org.pentaho.platform.api.data.IDBDatasourceService
        Parameters:
        dsName - The Datasource name (like "jdbc/SampleData")
        Returns:
        The unbound DS name (like "SampleData")
      • getCacheManager

        public org.pentaho.platform.api.engine.ICacheManager getCacheManager()
      • getDatasourceMgmtService

        public org.pentaho.platform.api.repository.datasource.IDatasourceMgmtService getDatasourceMgmtService()