Class TenantRoutingDataSource

java.lang.Object
org.springframework.jdbc.datasource.AbstractDataSource
org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
org.alfresco.repo.tenant.TenantRoutingDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource, org.springframework.beans.factory.InitializingBean

public class TenantRoutingDataSource extends org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
Experimental
Since:
4.2
Author:
janv
  • Field Summary

    Fields inherited from class org.springframework.jdbc.datasource.AbstractDataSource

    logger
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addTenantDataSource(String tenantDomain, String dbUrl)
     
    void
     
    protected Object
     
    void
     
    void
    setBaseDataSource(org.apache.commons.dbcp2.BasicDataSource baseDataSource)
     
    void
     

    Methods inherited from class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource

    createConnectionBuilder, createShardingKeyBuilder, determineTargetDataSource, getConnection, getConnection, getResolvedDataSources, getResolvedDefaultDataSource, initialize, isWrapperFor, resolveSpecifiedDataSource, resolveSpecifiedLookupKey, setDataSourceLookup, setDefaultTargetDataSource, setLenientFallback, setTargetDataSources, unwrap

    Methods inherited from class org.springframework.jdbc.datasource.AbstractDataSource

    getLoginTimeout, getLogWriter, getParentLogger, setLoginTimeout, setLogWriter

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • TenantRoutingDataSource

      public TenantRoutingDataSource()
  • Method Details

    • setTenantService

      public void setTenantService(TenantService tenantService)
    • setBaseDataSource

      public void setBaseDataSource(org.apache.commons.dbcp2.BasicDataSource baseDataSource)
    • determineCurrentLookupKey

      protected Object determineCurrentLookupKey()
      Specified by:
      determineCurrentLookupKey in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
    • afterPropertiesSet

      public void afterPropertiesSet()
      Specified by:
      afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource
    • addTenantDataSource

      public void addTenantDataSource(String tenantDomain, String dbUrl) throws SQLException
      Throws:
      SQLException
    • removeTenantDataSource

      public void removeTenantDataSource(String tenantDomain) throws SQLException
      Throws:
      SQLException