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

com.iteaj.iot.client.ClientProperties Maven / Gradle / Ivy

package com.iteaj.iot.client;

import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "iot.client")
public class ClientProperties {

    /**
     * 应用程序客户端代理配置
     */
    private ClientProxyConnectProperties proxy;

    public static class ClientProxyConnectProperties extends ClientConnectProperties {

        /**
         * 心跳周期(秒)
         */
        private int heart = 60;

        /**
         * 代理客户端编号(默认随机生成)
         */
        private String deviceSn;

        /**
         * 报文最大长度
         */
        private int maxFrameLength = 1024 * 1024;

        @Override
        public String connectKey() {
            return this.getHost() + ":" + this.getPort();
        }

        public int getHeart() {
            return heart;
        }

        public void setHeart(int heart) {
            this.heart = heart;
        }

        public String getDeviceSn() {
            return deviceSn;
        }

        public void setDeviceSn(String deviceSn) {
            this.deviceSn = deviceSn;
        }

        public int getMaxFrameLength() {
            return maxFrameLength;
        }

        public void setMaxFrameLength(int maxFrameLength) {
            this.maxFrameLength = maxFrameLength;
        }
    }

    public ClientProxyConnectProperties getProxy() {
        return proxy;
    }

    public void setProxy(ClientProxyConnectProperties proxy) {
        this.proxy = proxy;
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy