| | |
| | | continue; |
| | | } |
| | | //by brewswang |
| | | if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Longitude"))) {//如果包含位置信息,就更新一下位置 |
| | | processNotifyMobilePosition(evt, itemDevice); |
| | | } |
| | | |
| | | // if (NumericUtil.isDouble(XmlUtil.getText(itemDevice, "Longitude"))) {//如果包含位置信息,就更新一下位置 |
| | | // processNotifyMobilePosition(evt, itemDevice); |
| | | // } |
| | | DeviceChannel deviceChannel = XmlUtil.channelContentHander(itemDevice); |
| | | deviceChannel.setDeviceId(device.getDeviceId()); |
| | | logger.debug("收到来自设备【{}】的通道: {}【{}】", device.getDeviceId(), deviceChannel.getName(), deviceChannel.getChannelId()); |
| | | |
| | | channelList.add(deviceChannel); |
| | | } |
| | | |
| | | logger.info("收到来自设备【{}】的通道: {}个,{}/{}", device.getDeviceId(), channelList.size(), catalogDataCatch.get(key) == null ? 0 :catalogDataCatch.get(key).size(), sumNum); |
| | | catalogDataCatch.put(key, sumNum, device, channelList); |
| | | if (catalogDataCatch.get(key).size() == sumNum) { |
| | | // 数据已经完整接收 |
| | |
| | | } |
| | | // 回复200 OK |
| | | responseAck(evt, Response.OK); |
| | | if (offLineDetector.isOnline(device.getDeviceId())) { |
| | | publisher.onlineEventPublish(device, VideoManagerConstants.EVENT_ONLINE_MESSAGE); |
| | | } |
| | | } |
| | | } catch (DocumentException e) { |
| | | e.printStackTrace(); |
| | |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | public SyncStatus getChannelSyncProgress(String deviceId) { |
| | | String key = DeferredResultHolder.CALLBACK_CMD_CATALOG + deviceId; |
| | | if (catalogDataCatch.get(key) == null) { |
| | | return null; |
| | | }else { |
| | | return catalogDataCatch.getSyncStatus(key); |
| | | } |
| | | } |
| | | |
| | | public void setChannelSyncReady(String deviceId) { |
| | | String key = DeferredResultHolder.CALLBACK_CMD_CATALOG + deviceId; |
| | | catalogDataCatch.addReady(key); |
| | | } |
| | | |
| | | public void setChannelSyncEnd(String deviceId, String errorMsg) { |
| | | String key = DeferredResultHolder.CALLBACK_CMD_CATALOG + deviceId; |
| | | catalogDataCatch.setChannelSyncEnd(key, errorMsg); |
| | | } |
| | | } |