From 3496ca2378dccfbe37d2311e9d85e7c7b60726b0 Mon Sep 17 00:00:00 2001
From: 648540858 <648540858@qq.com>
Date: 星期二, 02 八月 2022 15:41:07 +0800
Subject: [PATCH] Merge pull request #353 from mrjackwang/wvp-28181-2.0
---
src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java | 55 ++++++++++++++++++++++++++-----------------------------
1 files changed, 26 insertions(+), 29 deletions(-)
diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
index e191578..4ce30a2 100644
--- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
+++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/request/impl/NotifyRequestProcessor.java
@@ -92,39 +92,36 @@
@Override
public void process(RequestEvent evt) {
try {
-
taskQueue.offer(new HandlerCatchData(evt, null, null));
responseAck(evt, Response.OK);
if (!taskQueueHandlerRun) {
taskQueueHandlerRun = true;
taskExecutor.execute(()-> {
- while (!taskQueue.isEmpty()) {
- try {
- HandlerCatchData take = taskQueue.poll();
- Element rootElement = getRootElement(take.getEvt());
- String cmd = XmlUtil.getText(rootElement, "CmdType");
+ while (!taskQueue.isEmpty()) {
+ try {
+ HandlerCatchData take = taskQueue.poll();
+ Element rootElement = getRootElement(take.getEvt());
+ String cmd = XmlUtil.getText(rootElement, "CmdType");
- if (CmdType.CATALOG.equals(cmd)) {
- logger.info("鎺ユ敹鍒癈atalog閫氱煡");
- processNotifyCatalogList(take.getEvt());
- } else if (CmdType.ALARM.equals(cmd)) {
- logger.info("鎺ユ敹鍒癆larm閫氱煡");
- processNotifyAlarm(take.getEvt());
- } else if (CmdType.MOBILE_POSITION.equals(cmd)) {
- logger.info("鎺ユ敹鍒癕obilePosition閫氱煡");
- processNotifyMobilePosition(take.getEvt());
- } else {
- logger.info("鎺ユ敹鍒版秷鎭細" + cmd);
- }
- } catch (DocumentException e) {
- throw new RuntimeException(e);
- }
+ if (CmdType.CATALOG.equals(cmd)) {
+ logger.info("鎺ユ敹鍒癈atalog閫氱煡");
+ processNotifyCatalogList(take.getEvt());
+ } else if (CmdType.ALARM.equals(cmd)) {
+ logger.info("鎺ユ敹鍒癆larm閫氱煡");
+ processNotifyAlarm(take.getEvt());
+ } else if (CmdType.MOBILE_POSITION.equals(cmd)) {
+ logger.info("鎺ユ敹鍒癕obilePosition閫氱煡");
+ processNotifyMobilePosition(take.getEvt());
+ } else {
+ logger.info("鎺ユ敹鍒版秷鎭細" + cmd);
}
- taskQueueHandlerRun = false;
- });
+ } catch (DocumentException e) {
+ throw new RuntimeException(e);
+ }
+ }
+ taskQueueHandlerRun = false;
+ });
}
-
-
} catch (SipException | InvalidArgumentException | ParseException e) {
e.printStackTrace();
}
@@ -174,7 +171,7 @@
} else {
mobilePosition.setAltitude(0.0);
}
- logger.info("[鏀跺埌 绉诲姩浣嶇疆璁㈤槄]锛歿}/{}->{}.{}", mobilePosition.getDeviceId(), mobilePosition.getChannelId(),
+ logger.info("[鏀跺埌绉诲姩浣嶇疆璁㈤槄閫氱煡]锛歿}/{}->{}.{}", mobilePosition.getDeviceId(), mobilePosition.getChannelId(),
mobilePosition.getLongitude(), mobilePosition.getLatitude());
mobilePosition.setReportSource("Mobile Position");
@@ -318,7 +315,7 @@
Device device = redisCatchStorage.getDevice(deviceId);
if (device == null || device.getOnline() == 0) {
- logger.warn("[鏀跺埌 鐩綍璁㈤槄]锛歿}, 浣嗘槸璁惧宸茬粡绂荤嚎", (device != null ? device.getDeviceId():"" ));
+ logger.warn("[鏀跺埌鐩綍璁㈤槄]锛歿}, 浣嗘槸璁惧宸茬粡绂荤嚎", (device != null ? device.getDeviceId():"" ));
return;
}
Element rootElement = getRootElement(evt, device.getCharset());
@@ -339,14 +336,14 @@
Element eventElement = itemDevice.element("Event");
String event;
if (eventElement == null) {
- logger.warn("[鏀跺埌 鐩綍璁㈤槄]锛歿}, 浣嗘槸Event涓虹┖, 璁句负榛樿鍊� ADD", (device != null ? device.getDeviceId():"" ));
+ logger.warn("[鏀跺埌鐩綍璁㈤槄]锛歿}, 浣嗘槸Event涓虹┖, 璁句负榛樿鍊� ADD", (device != null ? device.getDeviceId():"" ));
event = CatalogEvent.ADD;
}else {
event = eventElement.getText().toUpperCase();
}
DeviceChannel channel = XmlUtil.channelContentHander(itemDevice, device, event);
channel.setDeviceId(device.getDeviceId());
- logger.info("[鏀跺埌 鐩綍璁㈤槄]锛歿}/{}", device.getDeviceId(), channel.getChannelId());
+ logger.info("[鏀跺埌鐩綍璁㈤槄]锛歿}/{}", device.getDeviceId(), channel.getChannelId());
switch (event) {
case CatalogEvent.ON:
// 涓婄嚎
--
Gitblit v1.8.0