Class TenantRoutingDataSource

  • All Implemented Interfaces:
    java.sql.Wrapper, javax.sql.CommonDataSource, javax.sql.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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addTenantDataSource​(java.lang.String tenantDomain, java.lang.String dbUrl)  
      void afterPropertiesSet()  
      protected java.lang.Object determineCurrentLookupKey()  
      void removeTenantDataSource​(java.lang.String tenantDomain)  
      void setBaseDataSource​(org.apache.commons.dbcp.BasicDataSource baseDataSource)  
      void setTenantService​(org.alfresco.repo.tenant.TenantService tenantService)  
      • Methods inherited from class org.springframework.jdbc.datasource.lookup.AbstractRoutingDataSource

        determineTargetDataSource, getConnection, getConnection, 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
      • Methods inherited from interface javax.sql.CommonDataSource

        createShardingKeyBuilder
      • Methods inherited from interface javax.sql.DataSource

        createConnectionBuilder
    • Constructor Detail

      • TenantRoutingDataSource

        public TenantRoutingDataSource()
    • Method Detail

      • setTenantService

        public void setTenantService​(org.alfresco.repo.tenant.TenantService tenantService)
      • setBaseDataSource

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

        protected java.lang.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​(java.lang.String tenantDomain,
                                        java.lang.String dbUrl)
                                 throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • removeTenantDataSource

        public void removeTenantDataSource​(java.lang.String tenantDomain)
                                    throws java.sql.SQLException
        Throws:
        java.sql.SQLException