panlinlin
2021-01-15 cf8a22f50b81fa30abaa518bdce660cd65deabea
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
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
package com.genersoft.iot.vmp.storager;
 
import java.util.List;
import java.util.Map;
 
import com.genersoft.iot.vmp.common.StreamInfo;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.ParentPlatform;
import com.genersoft.iot.vmp.vmanager.platform.bean.ChannelReduce;
import com.github.pagehelper.PageInfo;
import gov.nist.javax.sip.stack.NioTcpMessageProcessor;
 
import javax.swing.event.ChangeEvent;
 
/**    
 * @Description:视频设备数据存储接口
 * @author: swwheihei
 * @date:   2020年5月6日 下午2:14:31     
 */
public interface IVideoManagerStorager {
 
    /**   
     * 根据设备ID判断设备是否存在
     * 
     * @param deviceId 设备ID
     * @return true:存在  false:不存在
     */
    public boolean exists(String deviceId);
    
    /**   
     * 视频设备创建
     * 
     * @param device 设备对象
     * @return true:创建成功  false:创建失败
     */
    public boolean create(Device device);
    
    /**   
     * 视频设备更新
     * 
     * @param device 设备对象
     * @return true:创建成功  false:创建失败
     */
    public boolean updateDevice(Device device);
 
    /**
     * 添加设备通道
     *
     * @param deviceId 设备id
     * @param channel 通道
     */
    public void updateChannel(String deviceId, DeviceChannel channel);
 
    /**
     * 开始播放
     * @param deviceId 设备id
     * @param channelId 通道ID
     * @param streamId 流地址
     */
    public void startPlay(String deviceId, String channelId, String streamId);
 
    /**
     * 停止播放
     * @param deviceId 设备id
     * @param channelId 通道ID
     */
    public void stopPlay(String deviceId, String channelId);
    
    /**   
     * 获取设备
     * 
     * @param deviceId 设备ID
     * @return DShadow 设备对象
     */
    public Device queryVideoDevice(String deviceId);
 
    /**
     * 获取某个设备的通道列表
     *
     * @param deviceId 设备ID
     * @param page 分页 当前页
     * @param count 每页数量
     * @return
     */
    public PageInfo queryChannelsByDeviceId(String deviceId, String query, Boolean hasSubChannel, Boolean online, int page, int count);
 
    /**
     * 获取某个设备的通道列表
     *
     * @param deviceId 设备ID
     * @return
     */
    public List<DeviceChannel> queryChannelsByDeviceId(String deviceId);
 
    /**
     * 获取某个设备的通道
     * @param deviceId 设备ID
     * @param channelId 通道ID
     */
    public DeviceChannel queryChannel(String deviceId, String channelId);
 
    /**
     * 获取多个设备
     * @param page 当前页数
     * @param count 每页数量
     * @return List<Device> 设备对象数组
     */
    public PageInfo<Device> queryVideoDeviceList(int page, int count);
 
    /**
     * 获取多个设备
     *
     * @return List<Device> 设备对象数组
     */
    public List<Device> queryVideoDeviceList();
 
    /**   
     * 删除设备
     * 
     * @param deviceId 设备ID
     * @return true:删除成功  false:删除失败
     */
    public boolean delete(String deviceId);
    
    /**   
     * 更新设备在线
     * 
     * @param deviceId 设备ID
     * @return true:更新成功  false:更新失败
     */
    public boolean online(String deviceId);
    
    /**   
     * 更新设备离线
     * 
     * @param deviceId 设备ID
     * @return true:更新成功  false:更新失败
     */
    public boolean outline(String deviceId);
 
 
    /**
     * 查询子设备
     *
     * @param deviceId
     * @param channelId
     * @param page
     * @param count
     * @return
     */
    PageInfo querySubChannels(String deviceId, String channelId, String query, Boolean hasSubChannel, String online, int page, int count);
 
 
    /**
     * 清空通道
     * @param deviceId
     */
    void cleanChannelsForDevice(String deviceId);
 
 
    /**
     * 更新上级平台
     * @param parentPlatform
     */
    boolean updateParentPlatform(ParentPlatform parentPlatform);
 
 
    /**
     * 添加上级平台
     * @param parentPlatform
     */
    boolean addParentPlatform(ParentPlatform parentPlatform);
 
    /**
     * 删除上级平台
     * @param parentPlatform
     */
    boolean deleteParentPlatform(ParentPlatform parentPlatform);
 
 
    /**
     * 分页获取上级平台
     * @param page
     * @param count
     * @return
     */
    PageInfo<ParentPlatform> queryParentPlatformList(int page, int count);
 
    /**
     * 获取所有已启用的平台
     * @return
     */
    List<ParentPlatform> queryEnableParentPlatformList(boolean enable);
 
    /**
     * 获取上级平台
     * @param platformGbId
     * @return
     */
    ParentPlatform queryParentPlatById(String platformGbId);
 
    /**
     * 所有平台离线
     */
    void outlineForAllParentPlatform();
 
    /**
     * 查询通道信息,不区分设备(已关联平台或全部)
     */
    PageInfo<ChannelReduce> queryAllChannelList(int page, int count, String query, Boolean online, Boolean channelType, String platformId, Boolean inPlatform);
 
    /**
     * 查询设备的通道信息
     */
    List<ChannelReduce> queryChannelListInParentPlatform(String platformId);
 
 
    /**
     * 更新上级平台的通道信息
     * @param platformId
     * @param channelReduces
     * @return
     */
    int updateChannelForGB(String platformId, List<ChannelReduce> channelReduces);
 
    /**
     *  移除上级平台的通道信息
     * @param platformId
     * @param channelReduces
     * @return
     */
    int delChannelForGB(String platformId, List<ChannelReduce> channelReduces);
 
 
}