songww
2020-05-13 ca5139929b8b5853229ca3d63e2bca1ce82fa0ab
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package com.genersoft.iot.vmp.gb28181.event;
 
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
 
import com.genersoft.iot.vmp.common.VideoManagerConstants;
import com.genersoft.iot.vmp.utils.redis.RedisUtil;
 
/**    
 * @Description:设备离在线状态检测器,用于检测设备状态
 * @author: songww
 * @date:   2020年5月13日 下午2:40:29     
 */
@Component
public class DeviceOffLineDetector {
 
    @Autowired
    private RedisUtil redis;
    
    public boolean isOnline(String deviceId) {
        String key = VideoManagerConstants.KEEPLIVEKEY_PREFIX + deviceId;
        return redis.hasKey(key);
    }
}