Class HighAvailableDataSource

java.lang.Object
com.alibaba.druid.pool.WrapperAdapter
com.alibaba.druid.pool.ha.HighAvailableDataSource
All Implemented Interfaces:
Wrapper, CommonDataSource, DataSource

public class HighAvailableDataSource extends WrapperAdapter implements DataSource
DataSource class which contains multiple DataSource objects.
Author:
DigitalSonic
  • Constructor Details

    • HighAvailableDataSource

      public HighAvailableDataSource()
  • Method Details

    • init

      public void init()
    • close

      public void close()
    • destroy

      public void destroy()
    • setTargetDataSource

      public void setTargetDataSource(String targetName)
    • getConnection

      public Connection getConnection() throws SQLException
      Specified by:
      getConnection in interface DataSource
      Throws:
      SQLException
    • getDataSourceFile

      public String getDataSourceFile()
    • setDataSourceFile

      public void setDataSourceFile(String dataSourceFile)
    • getPropertyPrefix

      public String getPropertyPrefix()
    • setPropertyPrefix

      public void setPropertyPrefix(String propertyPrefix)
    • setDataSourceMap

      public void setDataSourceMap(Map<String,DataSource> dataSourceMap)
    • getDataSourceMap

      public Map<String,DataSource> getDataSourceMap()
    • getAvailableDataSourceMap

      public Map<String,DataSource> getAvailableDataSourceMap()
    • addBlackList

      public void addBlackList(String name)
    • removeBlackList

      public void removeBlackList(String name)
    • isInBlackList

      public boolean isInBlackList(String name)
    • setSelector

      public void setSelector(String name)
    • getSelector

      public String getSelector()
    • getConnection

      public Connection getConnection(String username, String password) throws SQLException
      Specified by:
      getConnection in interface DataSource
      Throws:
      SQLException
    • setLoginTimeout

      public void setLoginTimeout(int seconds)
      Specified by:
      setLoginTimeout in interface CommonDataSource
      Specified by:
      setLoginTimeout in interface DataSource
    • getLoginTimeout

      public int getLoginTimeout()
      Specified by:
      getLoginTimeout in interface CommonDataSource
      Specified by:
      getLoginTimeout in interface DataSource
    • getParentLogger

      public Logger getParentLogger() throws SQLFeatureNotSupportedException
      Specified by:
      getParentLogger in interface CommonDataSource
      Throws:
      SQLFeatureNotSupportedException
    • setConnectionProperties

      public void setConnectionProperties(String connectionProperties)
    • setConnectProperties

      public void setConnectProperties(Properties connectProperties)
    • isAllowEmptyPoolWhenUpdate

      public boolean isAllowEmptyPoolWhenUpdate()
    • setAllowEmptyPoolWhenUpdate

      public void setAllowEmptyPoolWhenUpdate(boolean allowEmptyPoolWhenUpdate)
    • getPoolPurgeIntervalSeconds

      public int getPoolPurgeIntervalSeconds()
    • setPoolPurgeIntervalSeconds

      public void setPoolPurgeIntervalSeconds(int poolPurgeIntervalSeconds)
    • getNodeListener

      public NodeListener getNodeListener()
    • setNodeListener

      public void setNodeListener(NodeListener nodeListener)
    • getDataSourceSelector

      public DataSourceSelector getDataSourceSelector()
    • setDataSourceSelector

      public void setDataSourceSelector(DataSourceSelector dataSourceSelector)
    • getLogWriter

      public PrintWriter getLogWriter() throws SQLException
      Specified by:
      getLogWriter in interface CommonDataSource
      Specified by:
      getLogWriter in interface DataSource
      Throws:
      SQLException
    • setLogWriter

      public void setLogWriter(PrintWriter out) throws SQLException
      Specified by:
      setLogWriter in interface CommonDataSource
      Specified by:
      setLogWriter in interface DataSource
      Throws:
      SQLException
    • getDriverClassName

      public String getDriverClassName()
    • setDriverClassName

      public void setDriverClassName(String driverClassName)
    • getConnectProperties

      public Properties getConnectProperties()
    • getInitialSize

      public int getInitialSize()
    • setInitialSize

      public void setInitialSize(int initialSize)
    • getMaxActive

      public int getMaxActive()
    • setMaxActive

      public void setMaxActive(int maxActive)
    • getMinIdle

      public int getMinIdle()
    • setMinIdle

      public void setMinIdle(int minIdle)
    • getMaxWait

      public long getMaxWait()
    • setMaxWait

      public void setMaxWait(long maxWait)
    • getValidationQuery

      public String getValidationQuery()
    • setValidationQuery

      public void setValidationQuery(String validationQuery)
    • getValidationQueryTimeout

      public int getValidationQueryTimeout()
    • setValidationQueryTimeout

      public void setValidationQueryTimeout(int validationQueryTimeout)
    • isTestOnBorrow

      public boolean isTestOnBorrow()
    • setTestOnBorrow

      public void setTestOnBorrow(boolean testOnBorrow)
    • isTestOnReturn

      public boolean isTestOnReturn()
    • setTestOnReturn

      public void setTestOnReturn(boolean testOnReturn)
    • isTestWhileIdle

      public boolean isTestWhileIdle()
    • setTestWhileIdle

      public void setTestWhileIdle(boolean testWhileIdle)
    • isPoolPreparedStatements

      public boolean isPoolPreparedStatements()
    • setPoolPreparedStatements

      public void setPoolPreparedStatements(boolean poolPreparedStatements)
    • isSharePreparedStatements

      public boolean isSharePreparedStatements()
    • setSharePreparedStatements

      public void setSharePreparedStatements(boolean sharePreparedStatements)
    • getMaxPoolPreparedStatementPerConnectionSize

      public int getMaxPoolPreparedStatementPerConnectionSize()
    • setMaxPoolPreparedStatementPerConnectionSize

      public void setMaxPoolPreparedStatementPerConnectionSize(int maxPoolPreparedStatementPerConnectionSize)
    • getQueryTimeout

      public int getQueryTimeout()
    • setQueryTimeout

      public void setQueryTimeout(int queryTimeout)
    • getTransactionQueryTimeout

      public int getTransactionQueryTimeout()
    • setTransactionQueryTimeout

      public void setTransactionQueryTimeout(int transactionQueryTimeout)
    • getTimeBetweenEvictionRunsMillis

      public long getTimeBetweenEvictionRunsMillis()
    • setTimeBetweenEvictionRunsMillis

      public void setTimeBetweenEvictionRunsMillis(long timeBetweenEvictionRunsMillis)
    • getMinEvictableIdleTimeMillis

      public long getMinEvictableIdleTimeMillis()
    • setMinEvictableIdleTimeMillis

      public void setMinEvictableIdleTimeMillis(long minEvictableIdleTimeMillis)
    • getMaxEvictableIdleTimeMillis

      public long getMaxEvictableIdleTimeMillis()
    • setMaxEvictableIdleTimeMillis

      public void setMaxEvictableIdleTimeMillis(long maxEvictableIdleTimeMillis)
    • getPhyTimeoutMillis

      public long getPhyTimeoutMillis()
    • setPhyTimeoutMillis

      public void setPhyTimeoutMillis(long phyTimeoutMillis)
    • getTimeBetweenConnectErrorMillis

      public long getTimeBetweenConnectErrorMillis()
    • setTimeBetweenConnectErrorMillis

      public void setTimeBetweenConnectErrorMillis(long timeBetweenConnectErrorMillis)
    • isRemoveAbandoned

      public boolean isRemoveAbandoned()
    • setRemoveAbandoned

      public void setRemoveAbandoned(boolean removeAbandoned)
    • getRemoveAbandonedTimeoutMillis

      public long getRemoveAbandonedTimeoutMillis()
    • setRemoveAbandonedTimeoutMillis

      public void setRemoveAbandonedTimeoutMillis(long removeAbandonedTimeoutMillis)
    • isLogAbandoned

      public boolean isLogAbandoned()
    • setLogAbandoned

      public void setLogAbandoned(boolean logAbandoned)
    • getConnectionProperties

      public String getConnectionProperties()
    • getFilters

      public String getFilters()
    • setFilters

      public void setFilters(String filters)
    • getProxyFilters

      public List<Filter> getProxyFilters()
    • setProxyFilters

      public void setProxyFilters(List<Filter> proxyFilters)