package com.leanwo.activiti.db;


import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.stereotype.Component;


/**
 * 数据源配置模板
 * @author YangZhiJie
 * @date 2020/07/04
 */
@Component
@RefreshScope
public class DataSourceTemplate {

    @Value("${template.dataSource.initialSize}")
    private Integer initialSize;

    @Value("${template.dataSource.minIdle}")
    private Integer minIdle;

    @Value("${template.dataSource.maxActive}")
    private Integer maxActive;

    @Value("${template.dataSource.maxWait}")
    private Integer maxWait;

    @Value("${template.dataSource.timeBetweenEvictionRunsMillis}")
    private Integer timeBetweenEvictionRunsMillis;

    @Value("${template.dataSource.minEvictableIdleTimeMillis}")
    private Integer minEvictableIdleTimeMillis;

    @Value("${template.dataSource.validationQuery}")
    private String validationQuery;

    @Value("${template.dataSource.testWhileIdle}")
    private Boolean testWhileIdle;

    @Value("${template.dataSource.testOnBorrow}")
    private Boolean testOnBorrow;

    @Value("${template.dataSource.testOnReturn}")
    private Boolean testOnReturn;

    @Value("${template.dataSource.poolPreparedStatements}")
    private Boolean poolPreparedStatements;

    @Value("${template.dataSource.maxPoolPreparedStatementPerConnectionSize}")
    private Integer maxPoolPreparedStatementPerConnectionSize;
    
    @Value("${template.dataSource.removeAbandoned}")
    private Boolean removeAbandoned;

    @Value("${template.dataSource.removeAbandonedTimeout}")
    private Integer removeAbandonedTimeout;
    
    @Value("${template.dataSource.logAbandoned}")
    private Boolean logAbandoned;

    @Value("${template.dataSource.filters}")
    private String filters;

    /**
     * @return the initialSize
     */
    public Integer getInitialSize() {
        return initialSize;
    }

    /**
     * @param initialSize the initialSize to set
     */
    public void setInitialSize(Integer initialSize) {
        this.initialSize = initialSize;
    }

    /**
     * @return the minIdle
     */
    public Integer getMinIdle() {
        return minIdle;
    }

    /**
     * @param minIdle the minIdle to set
     */
    public void setMinIdle(Integer minIdle) {
        this.minIdle = minIdle;
    }

    /**
     * @return the maxActive
     */
    public Integer getMaxActive() {
        return maxActive;
    }

    /**
     * @param maxActive the maxActive to set
     */
    public void setMaxActive(Integer maxActive) {
        this.maxActive = maxActive;
    }

    /**
     * @return the maxWait
     */
    public Integer getMaxWait() {
        return maxWait;
    }

    /**
     * @param maxWait the maxWait to set
     */
    public void setMaxWait(Integer maxWait) {
        this.maxWait = maxWait;
    }

    /**
     * @return the timeBetweenEvictionRunsMillis
     */
    public Integer getTimeBetweenEvictionRunsMillis() {
        return timeBetweenEvictionRunsMillis;
    }

    /**
     * @param timeBetweenEvictionRunsMillis the timeBetweenEvictionRunsMillis to set
     */
    public void setTimeBetweenEvictionRunsMillis(Integer timeBetweenEvictionRunsMillis) {
        this.timeBetweenEvictionRunsMillis = timeBetweenEvictionRunsMillis;
    }

    /**
     * @return the minEvictableIdleTimeMillis
     */
    public Integer getMinEvictableIdleTimeMillis() {
        return minEvictableIdleTimeMillis;
    }

    /**
     * @param minEvictableIdleTimeMillis the minEvictableIdleTimeMillis to set
     */
    public void setMinEvictableIdleTimeMillis(Integer minEvictableIdleTimeMillis) {
        this.minEvictableIdleTimeMillis = minEvictableIdleTimeMillis;
    }

    /**
     * @return the validationQuery
     */
    public String getValidationQuery() {
        return validationQuery;
    }

    /**
     * @param validationQuery the validationQuery to set
     */
    public void setValidationQuery(String validationQuery) {
        this.validationQuery = validationQuery;
    }

    /**
     * @return the testWhileIdle
     */
    public Boolean getTestWhileIdle() {
        return testWhileIdle;
    }

    /**
     * @param testWhileIdle the testWhileIdle to set
     */
    public void setTestWhileIdle(Boolean testWhileIdle) {
        this.testWhileIdle = testWhileIdle;
    }

    /**
     * @return the testOnBorrow
     */
    public Boolean getTestOnBorrow() {
        return testOnBorrow;
    }

    /**
     * @param testOnBorrow the testOnBorrow to set
     */
    public void setTestOnBorrow(Boolean testOnBorrow) {
        this.testOnBorrow = testOnBorrow;
    }

    /**
     * @return the testOnReturn
     */
    public Boolean getTestOnReturn() {
        return testOnReturn;
    }

    /**
     * @param testOnReturn the testOnReturn to set
     */
    public void setTestOnReturn(Boolean testOnReturn) {
        this.testOnReturn = testOnReturn;
    }

    /**
     * @return the poolPreparedStatements
     */
    public Boolean getPoolPreparedStatements() {
        return poolPreparedStatements;
    }

    /**
     * @param poolPreparedStatements the poolPreparedStatements to set
     */
    public void setPoolPreparedStatements(Boolean poolPreparedStatements) {
        this.poolPreparedStatements = poolPreparedStatements;
    }

    /**
     * @return the maxPoolPreparedStatementPerConnectionSize
     */
    public Integer getMaxPoolPreparedStatementPerConnectionSize() {
        return maxPoolPreparedStatementPerConnectionSize;
    }

    /**
     * @param maxPoolPreparedStatementPerConnectionSize the maxPoolPreparedStatementPerConnectionSize to set
     */
    public void setMaxPoolPreparedStatementPerConnectionSize(Integer maxPoolPreparedStatementPerConnectionSize) {
        this.maxPoolPreparedStatementPerConnectionSize = maxPoolPreparedStatementPerConnectionSize;
    }

    /**
     * @return the removeAbandoned
     */
    public Boolean getRemoveAbandoned() {
        return removeAbandoned;
    }

    /**
     * @param removeAbandoned the removeAbandoned to set
     */
    public void setRemoveAbandoned(Boolean removeAbandoned) {
        this.removeAbandoned = removeAbandoned;
    }

    /**
     * @return the removeAbandonedTimeout
     */
    public Integer getRemoveAbandonedTimeout() {
        return removeAbandonedTimeout;
    }

    /**
     * @param removeAbandonedTimeout the removeAbandonedTimeout to set
     */
    public void setRemoveAbandonedTimeout(Integer removeAbandonedTimeout) {
        this.removeAbandonedTimeout = removeAbandonedTimeout;
    }

    /**
     * @return the logAbandoned
     */
    public Boolean getLogAbandoned() {
        return logAbandoned;
    }

    /**
     * @param logAbandoned the logAbandoned to set
     */
    public void setLogAbandoned(Boolean logAbandoned) {
        this.logAbandoned = logAbandoned;
    }

    /**
     * @return the filters
     */
    public String getFilters() {
        return filters;
    }

    /**
     * @param filters the filters to set
     */
    public void setFilters(String filters) {
        this.filters = filters;
    }
}
