package com.zd.laboratory.socket.properties;

import com.zd.laboratory.socket.runner.SocketRunner;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.context.annotation.Configuration;

import java.util.Set;

/**
 * @author dgs
 * socket 参数数据配置类
 */
@Configuration
@RefreshScope
@ConfigurationProperties(prefix = "socket")
public class SocketProperties {
    private Integer port;
    private Integer poolKeep;
    private Integer poolCore;
    private Integer poolMax;
    private Integer poolQueueInit;
    private String requestUrl;
    /**
     * 白名单
     */

    private Set<String> whitelist;

    public Set<String> getWhitelist() {
        return whitelist;
    }

    public void setWhitelist(Set<String> whitelist) {
        this.whitelist = whitelist;
        SocketRunner.whitelist=whitelist;

    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Integer getPoolKeep() {
        return poolKeep;
    }

    public void setPoolKeep(Integer poolKeep) {
        this.poolKeep = poolKeep;
    }

    public Integer getPoolCore() {
        return poolCore;
    }

    public void setPoolCore(Integer poolCore) {
        this.poolCore = poolCore;
    }

    public Integer getPoolMax() {
        return poolMax;
    }

    public void setPoolMax(Integer poolMax) {
        this.poolMax = poolMax;
    }

    public Integer getPoolQueueInit() {
        return poolQueueInit;
    }

    public void setPoolQueueInit(Integer poolQueueInit) {
        this.poolQueueInit = poolQueueInit;
    }


    public String getRequestUrl() {
        return requestUrl;
    }

    public void setRequestUrl(String requestUrl) {
        this.requestUrl = requestUrl;
    }
}
