liurunyu
2024-08-15 f7e731bdc2fce4445c0d22993134c6c2b07d207b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/**
 * Project Name:socket-server File Name:ServerPeriod.java Package Name:com.xhb.sockserv.config
 * Date:Mar 3, 201712:26:11 PM Copyright (c) 2017, lorisun@live.com All Rights Reserved.
 */
 
package com.ruoyi.netty.communication;
 
/**
 * @author Joker
 * @ClassName:ServerPeriod
 * @Function: TODO ADD FUNCTION.
 * @Reason: TODO ADD REASON.
 * @Date: Mar 3, 2017 12:26:11 PM
 * @see
 * @since JDK 1.8
 */
public enum ServerPeriod {
    /**
     * 常用延时时间 30秒
     */
    DELAY("delay", 30),
    /**
     * 常用周期时间 30秒
     */
    PERIOD("period", 30),
    /**
     * 心跳延时时间
     */
    HEART_BEAT_DELAY("heartBeatDelay", 0),
    /**
     * 心跳周期
     */
    HEART_BEAT_PERIOD("heartBeatPeriod", 3),
    /**
     * 历史数据读取周期 900
     */
    READ_HISTORY_PERIOD("readHistoryPeriod", 900000L),
    /**
     * 超时时间 10分钟
     */
    // TIMEOUT("timeout", 60*60);
    TIMEOUT("timeout", 5 * 60);
 
    private String name;
    private long value;
 
    private ServerPeriod(String name, long value) {
        this.name = name;
        this.value = value;
    }
 
    public String getName() {
        return name;
    }
 
    public void setName(String name) {
        this.name = name == null ? "" : name;
    }
 
    public long getValue() {
        return value;
    }
 
    public void setValue(long value) {
        this.value = value;
    }
 
    @Override
    public String toString() {
        return this.value + ":" + this.name;
    }
}