| | |
| | | subscribeInfo.setDialog(dialog); |
| | | } |
| | | String sn = XmlUtil.getText(rootElement, "SN"); |
| | | String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "_MobilePosition_" + platformId; |
| | | logger.info("[notify-MobilePosition]: {}", platformId); |
| | | logger.info("[回复 移动位置订阅]: {}", platformId); |
| | | StringBuilder resultXml = new StringBuilder(200); |
| | | resultXml.append("<?xml version=\"1.0\" ?>\r\n") |
| | | .append("<Response>\r\n") |
| | |
| | | .append("</Response>\r\n"); |
| | | |
| | | if (subscribeInfo.getExpires() > 0) { |
| | | if (subscribeHolder.getMobilePositionSubscribe(platformId) != null) { |
| | | dynamicTask.stop(key); |
| | | } |
| | | String interval = XmlUtil.getText(rootElement, "Interval"); // GPS上报时间间隔 |
| | | dynamicTask.startCron(key, new MobilePositionSubscribeHandlerTask(redisCatchStorage, sipCommanderForPlatform, storager, platformId, sn, key, subscribeHolder), Integer.parseInt(interval) -1 ); |
| | | if (interval == null) { |
| | | subscribeInfo.setGpsInterval(5); |
| | | }else { |
| | | subscribeInfo.setGpsInterval(Integer.parseInt(interval)); |
| | | } |
| | | |
| | | subscribeInfo.setSn(sn); |
| | | subscribeHolder.putMobilePositionSubscribe(platformId, subscribeInfo); |
| | | // if (subscribeHolder.getMobilePositionSubscribe(platformId) == null ) { |
| | | // subscribeHolder.putMobilePositionSubscribe(platformId, subscribeInfo); |
| | | // }else { |
| | | // if (subscribeHolder.getMobilePositionSubscribe(platformId).getDialog() != null |
| | | // && subscribeHolder.getMobilePositionSubscribe(platformId).getDialog().getState() != null |
| | | // && !subscribeHolder.getMobilePositionSubscribe(platformId).getDialog().getState().equals(DialogState.CONFIRMED)) { |
| | | // subscribeHolder.putMobilePositionSubscribe(platformId, subscribeInfo); |
| | | // } |
| | | // } |
| | | }else if (subscribeInfo.getExpires() == 0) { |
| | | dynamicTask.stop(key); |
| | | subscribeHolder.removeMobilePositionSubscribe(platformId); |
| | | } |
| | | |
| | |
| | | subscribeInfo.setDialog(dialog); |
| | | } |
| | | String sn = XmlUtil.getText(rootElement, "SN"); |
| | | String key = VideoManagerConstants.SIP_SUBSCRIBE_PREFIX + userSetting.getServerId() + "_Catalog_" + platformId; |
| | | logger.info("[notify-Catalog]: {}", platformId); |
| | | logger.info("[回复 目录订阅]: {}/{}", platformId, deviceID); |
| | | StringBuilder resultXml = new StringBuilder(200); |
| | | resultXml.append("<?xml version=\"1.0\" ?>\r\n") |
| | | .append("<Response>\r\n") |