org.pentaho.platform.engine.services.connection.datasource.dbcp.tenantaware
Class TenantAwareSessionVariableDatasourceService

java.lang.Object
  extended by org.pentaho.platform.engine.services.connection.datasource.dbcp.BaseDatasourceService
      extended by org.pentaho.platform.engine.services.connection.datasource.dbcp.PooledOrJndiDatasourceService
          extended by org.pentaho.platform.engine.services.connection.datasource.dbcp.tenantaware.AbstractTenantAwareDatasourceService
              extended by org.pentaho.platform.engine.services.connection.datasource.dbcp.tenantaware.TenantAwareSessionVariableDatasourceService
All Implemented Interfaces:
IDatasourceService, org.springframework.beans.factory.InitializingBean

public class TenantAwareSessionVariableDatasourceService
extends AbstractTenantAwareDatasourceService
implements org.springframework.beans.factory.InitializingBean

This reference implementation retrieves the tenant ID from a variable in the users' session. The only option here is the name of the session variable.

Author:
mbatchelor

Field Summary
 
Fields inherited from interface org.pentaho.platform.api.data.IDatasourceService
IDATASOURCE_SERVICE, JDBC_DATASOURCE, JDBC_POOL
 
Constructor Summary
TenantAwareSessionVariableDatasourceService()
           
 
Method Summary
 void afterPropertiesSet()
           
 String getTenantId()
          This abstract method must be implemented by subclasses - this should return a string containing the tenant's ID.
 String getTenantSessionVariableName()
           
 void setTenantSessionVariableName(String value)
          Getters and Setters
 
Methods inherited from class org.pentaho.platform.engine.services.connection.datasource.dbcp.tenantaware.AbstractTenantAwareDatasourceService
getDataSource, getDatasourceNameFormat, isRequireTenantId, setDatasourceNameFormat, setRequireTenantId
 
Methods inherited from class org.pentaho.platform.engine.services.connection.datasource.dbcp.PooledOrJndiDatasourceService
clearCache, clearDataSource
 
Methods inherited from class org.pentaho.platform.engine.services.connection.datasource.dbcp.BaseDatasourceService
getDSBoundName, getDSUnboundName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TenantAwareSessionVariableDatasourceService

public TenantAwareSessionVariableDatasourceService()
Method Detail

afterPropertiesSet

public void afterPropertiesSet()
                        throws Exception
Specified by:
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
Overrides:
afterPropertiesSet in class AbstractTenantAwareDatasourceService
Throws:
Exception

getTenantId

public String getTenantId()
Description copied from class: AbstractTenantAwareDatasourceService
This abstract method must be implemented by subclasses - this should return a string containing the tenant's ID.

Specified by:
getTenantId in class AbstractTenantAwareDatasourceService
Returns:
String ID of the Tenant

setTenantSessionVariableName

public void setTenantSessionVariableName(String value)
Getters and Setters


getTenantSessionVariableName

public String getTenantSessionVariableName()