leesam
2024-04-10 16b7e4a7ef473a6af29ec78aeb2f471fa398efdd
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package com.genersoft.iot.vmp.media.event.hook;
 
/**
 * zlm hook事件的参数
 * @author lin
 */
public class Hook {
 
    private HookType hookType;
 
    private String app;
 
    private String stream;
 
    private String mediaServerId;
 
    private Long createTime;
 
    public static Hook getInstance(HookType hookType, String app, String stream, String mediaServerId) {
        Hook hookSubscribe = new Hook();
        hookSubscribe.setApp(app);
        hookSubscribe.setStream(stream);
        hookSubscribe.setHookType(hookType);
        hookSubscribe.setMediaServerId(mediaServerId);
        hookSubscribe.setCreateTime(System.currentTimeMillis());
        return hookSubscribe;
    }
 
    public HookType getHookType() {
        return hookType;
    }
 
    public void setHookType(HookType hookType) {
        this.hookType = hookType;
    }
 
    public String getApp() {
        return app;
    }
 
    public void setApp(String app) {
        this.app = app;
    }
 
    public String getStream() {
        return stream;
    }
 
    public void setStream(String stream) {
        this.stream = stream;
    }
 
    public Long getCreateTime() {
        return createTime;
    }
 
    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }
 
    public String getMediaServerId() {
        return mediaServerId;
    }
 
    public void setMediaServerId(String mediaServerId) {
        this.mediaServerId = mediaServerId;
    }
 
    @Override
    public boolean equals(Object obj) {
        if (obj instanceof Hook) {
            Hook param = (Hook) obj;
            return param.getHookType().equals(this.hookType)
                    && param.getApp().equals(this.app)
                    && param.getStream().equals(this.stream)
                    && param.getMediaServerId().equals(this.mediaServerId);
        }else {
            return false;
        }
    }
 
    @Override
    public String toString() {
        return this.getHookType() + this.getApp() + this.getStream() + this.getMediaServerId();
    }
}