All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.dahuatech.icc.oauth.model.v202010.HttpConfigInfo Maven / Gradle / Ivy

The newest version!
package com.dahuatech.icc.oauth.model.v202010;

public class HttpConfigInfo {

    /** 平台服务IP或域名 */
    protected String host;
    /** 配置config */
    protected boolean isEnableHttpTest = false;
    /**https访问端口 默认443*/
    protected String httpsPort = "443";
    /**http访问端口 默认83,前提运维平台需要开启http调试模式*/
    protected String httpPort = "83";
    /**连接超时设置,单位毫秒*/
    protected Long connectionTimeout = -1l;
    /**读取超时设置,单位毫秒*/
    protected Long readTimeout = -1l;

    public HttpConfigInfo(String host,boolean isEnableHttpTest,String httpsPort,String httpPort){
        this(host);
        this.isEnableHttpTest = isEnableHttpTest;
        this.httpsPort = httpsPort == null?"443":httpsPort;
        this.httpPort = httpPort == null?"83":httpPort;
    }

    public HttpConfigInfo(String host){
        this.host = host;
    }

    public boolean isEnableHttpTest() {
        return isEnableHttpTest;
    }

    public void setEnableHttpTest(boolean enableHttpTest) {
        isEnableHttpTest = enableHttpTest;
    }

    public String getHttpsPort() {
        return httpsPort;
    }

    public void setHttpsPort(String httpsPort) {
        this.httpsPort = httpsPort;
    }

    public String getHttpPort() {
        return httpPort;
    }

    public void setHttpPort(String httpPort) {
        this.httpPort = httpPort;
    }

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }

    public Long getConnectionTimeout() {
        return connectionTimeout;
    }

    public void setConnectionTimeout(Long connectionTimeout) {
        this.connectionTimeout = connectionTimeout;
    }

    public Long getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(Long readTimeout) {
        this.readTimeout = readTimeout;
    }

    public String getPrefixUrl(){
        if(!isEnableHttpTest){
            return "https://" + host + ":" + httpsPort;
        }else{
            return "http://" + host + ":" + httpPort;
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy