lin
2022-01-08 abb60593cb77e9e9b6e67e8276fc416c2aede43f
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
package com.genersoft.iot.vmp.storager;
 
import com.alibaba.fastjson.JSONObject;
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
import com.genersoft.iot.vmp.service.bean.GPSMsgInfo;
import com.genersoft.iot.vmp.service.bean.ThirdPartyGB;
 
import java.util.List;
import java.util.Map;
 
public interface IRedisCatchStorage {
 
    /**
     * 计数器。为cseq进行计数
     *
     * @param method sip 方法
     * @return
     */
    Long getCSEQ(String method);
 
    /**
     * 开始播放时将流存入
     *
     * @param stream 流信息
     * @return
     */
    boolean startPlay(StreamInfo stream);
 
 
    /**
     * 停止播放时删除
     *
     * @return
     */
    boolean stopPlay(StreamInfo streamInfo);
 
    /**
     * 查询播放列表
     * @return
     */
    StreamInfo queryPlay(StreamInfo streamInfo);
 
    StreamInfo queryPlayByStreamId(String steamId);
 
    StreamInfo queryPlaybackByStreamId(String steamId);
 
    StreamInfo queryPlayByDevice(String deviceId, String channelId);
 
    Map<String, StreamInfo> queryPlayByDeviceId(String deviceId);
 
    boolean startPlayback(StreamInfo stream);
 
    boolean stopPlayback(StreamInfo streamInfo);
 
    StreamInfo queryPlaybackByDevice(String deviceId, String code);
 
    void updatePlatformCatchInfo(ParentPlatformCatch parentPlatformCatch);
 
    ParentPlatformCatch queryPlatformCatchInfo(String platformGbId);
 
    void delPlatformCatchInfo(String platformGbId);
 
    void updatePlatformKeepalive(ParentPlatform parentPlatform);
 
    void delPlatformKeepalive(String platformGbId);
 
    void updatePlatformRegister(ParentPlatform parentPlatform);
 
    void delPlatformRegister(String platformGbId);
 
    void updatePlatformRegisterInfo(String callId, String platformGbId);
 
    String queryPlatformRegisterInfo(String callId);
 
    void delPlatformRegisterInfo(String callId);
 
    void cleanPlatformRegisterInfos();
 
    void updateSendRTPSever(SendRtpItem sendRtpItem);
 
    /**
     * 查询RTP推送信息缓存
     * @param platformGbId
     * @param channelId
     * @return sendRtpItem
     */
    SendRtpItem querySendRTPServer(String platformGbId, String channelId);
 
    List<SendRtpItem> querySendRTPServer(String platformGbId);
 
    /**
     * 删除RTP推送信息缓存
     * @param platformGbId
     * @param channelId
     */
    void deleteSendRTPServer(String platformGbId, String channelId);
 
    /**
     * 查询某个通道是否存在上级点播(RTP推送)
     * @param channelId
     */
    boolean isChannelSendingRTP(String channelId);
 
    /**
     * 清空某个设备的所有缓存
     * @param deviceId 设备ID
     */
    void clearCatchByDeviceId(String deviceId);
 
    /**
     * 获取mediaServer节点
     * @param mediaServerId
     * @return
     */
//    MediaServerItem getMediaInfo(String mediaServerId);
 
    /**
     * 设置所有设备离线
     */
    void outlineForAll();
 
    /**
     * 获取所有在线的
     */
    List<String> getOnlineForAll();
 
    /**
     * 在redis添加wvp的信息
     */
    void updateWVPInfo(JSONObject jsonObject, int time);
 
    /**
     * 发送推流生成与推流消失消息
     * @param jsonObject 消息内容
     */
    void sendStreamChangeMsg(String type, JSONObject jsonObject);
 
    /**
     * 添加流信息到redis
     * @param mediaServerItem
     * @param app
     * @param streamId
     */
    void addStream(MediaServerItem mediaServerItem, String type, String app, String streamId, StreamInfo streamInfo);
 
    /**
     * 移除流信息从redis
     * @param mediaServerId
     * @param app
     * @param streamId
     */
    void removeStream(String mediaServerId, String type, String app, String streamId);
 
 
    /**
     * 移除流信息从redis
     * @param mediaServerId
     */
    void removeStream(String mediaServerId, String type);
 
    /**
     * 开始下载录像时存入
     * @param streamInfo
     */
    boolean startDownload(StreamInfo streamInfo);
 
    StreamInfo queryDownloadByStreamId(String streamId);
 
    /**
     * 查找第三方系统留下的国标预设值
     * @param queryKey
     * @return
     */
    ThirdPartyGB queryMemberNoGBId(String queryKey);
 
    List<StreamInfo> getStreams(String mediaServerId, String pull);
 
    /**
     * 将device信息写入redis
     * @param device
     */
    void updateDevice(Device device);
 
    void removeDevice(String deviceId);
 
    /**
     * 获取Device
     */
    Device getDevice(String deviceId);
 
    void resetAllCSEQ();
 
    void updateGpsMsgInfo(GPSMsgInfo gpsMsgInfo);
 
    GPSMsgInfo getGpsMsgInfo(String gbId);
    List<GPSMsgInfo> getAllGpsMsgInfo();
 
    Long getSN(String method);
 
    void resetAllSN();
 
    void updateSubscribe(String key, SubscribeInfo subscribeInfo);
 
    SubscribeInfo getSubscribe(String key);
 
    void delSubscribe(String key);
}