fix VideoManagerConstants.SIP_SUBSCRIBE_PREFIX key set
parent
cde7f6460a
commit
7155680793
|
@ -2,12 +2,9 @@ package com.genersoft.iot.vmp.gb28181.bean;
|
||||||
|
|
||||||
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
import com.genersoft.iot.vmp.common.VideoManagerConstants;
|
||||||
import com.genersoft.iot.vmp.conf.DynamicTask;
|
import com.genersoft.iot.vmp.conf.DynamicTask;
|
||||||
|
import com.genersoft.iot.vmp.conf.UserSetting;
|
||||||
import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
|
import com.genersoft.iot.vmp.gb28181.task.ISubscribeTask;
|
||||||
import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask;
|
import com.genersoft.iot.vmp.gb28181.task.impl.MobilePositionSubscribeHandlerTask;
|
||||||
import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform;
|
|
||||||
import com.genersoft.iot.vmp.service.IPlatformService;
|
|
||||||
import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
|
|
||||||
import com.genersoft.iot.vmp.storager.IVideoManagerStorage;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@ -24,6 +21,9 @@ public class SubscribeHolder {
|
||||||
@Autowired
|
@Autowired
|
||||||
private DynamicTask dynamicTask;
|
private DynamicTask dynamicTask;
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private UserSetting userSetting;
|
||||||
|
|
||||||
private final String taskOverduePrefix = "subscribe_overdue_";
|
private final String taskOverduePrefix = "subscribe_overdue_";
|
||||||
|
|
||||||
private static ConcurrentHashMap<String, SubscribeInfo> catalogMap = new ConcurrentHashMap<>();
|
private static ConcurrentHashMap<String, SubscribeInfo> catalogMap = new ConcurrentHashMap<>();
|
||||||
|
@ -58,7 +58,7 @@ public class SubscribeHolder {
|
||||||
|
|
||||||
public void putMobilePositionSubscribe(String platformId, SubscribeInfo subscribeInfo) {
|
public void putMobilePositionSubscribe(String platformId, SubscribeInfo subscribeInfo) {
|
||||||
mobilePositionMap.put(platformId, subscribeInfo);
|
mobilePositionMap.put(platformId, subscribeInfo);
|
||||||
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + "MobilePosition_" + platformId;
|
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId;
|
||||||
// 添加任务处理GPS定时推送
|
// 添加任务处理GPS定时推送
|
||||||
dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(platformId),
|
dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(platformId),
|
||||||
subscribeInfo.getGpsInterval() * 1000);
|
subscribeInfo.getGpsInterval() * 1000);
|
||||||
|
@ -76,7 +76,7 @@ public class SubscribeHolder {
|
||||||
|
|
||||||
public void removeMobilePositionSubscribe(String platformId) {
|
public void removeMobilePositionSubscribe(String platformId) {
|
||||||
mobilePositionMap.remove(platformId);
|
mobilePositionMap.remove(platformId);
|
||||||
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + "MobilePosition_" + platformId;
|
String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "MobilePosition_" + platformId;
|
||||||
// 结束任务处理GPS定时推送
|
// 结束任务处理GPS定时推送
|
||||||
dynamicTask.stop(key);
|
dynamicTask.stop(key);
|
||||||
String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId;
|
String taskOverdueKey = taskOverduePrefix + "MobilePosition_" + platformId;
|
||||||
|
|
Loading…
Reference in New Issue