Commit 5a3b1c04d6990879531f360423003a59e76a6f89
1 parent
97a87542
补充日志
Showing
1 changed file
with
6 additions
and
1 deletions
src/main/java/com/genersoft/iot/vmp/gb28181/event/record/RecordEndEventListener.java
| @@ -35,7 +35,7 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | @@ -35,7 +35,7 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | ||
| 35 | int sumNum = event.getRecordInfo().getSumNum(); | 35 | int sumNum = event.getRecordInfo().getSumNum(); |
| 36 | logger.info("录像查询完成事件触发,deviceId:{}, channelId: {}, 录像数量{}/{}条", event.getRecordInfo().getDeviceId(), | 36 | logger.info("录像查询完成事件触发,deviceId:{}, channelId: {}, 录像数量{}/{}条", event.getRecordInfo().getDeviceId(), |
| 37 | event.getRecordInfo().getChannelId(), count,sumNum); | 37 | event.getRecordInfo().getChannelId(), count,sumNum); |
| 38 | - if (handlerMap.size() > 0) { | 38 | + if (!handlerMap.isEmpty()) { |
| 39 | RecordEndEventHandler handler = handlerMap.get(deviceId + channelId); | 39 | RecordEndEventHandler handler = handlerMap.get(deviceId + channelId); |
| 40 | if (handler !=null){ | 40 | if (handler !=null){ |
| 41 | handler.handler(event.getRecordInfo()); | 41 | handler.handler(event.getRecordInfo()); |
| @@ -43,6 +43,9 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | @@ -43,6 +43,9 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | ||
| 43 | handlerMap.remove(deviceId + channelId); | 43 | handlerMap.remove(deviceId + channelId); |
| 44 | } | 44 | } |
| 45 | } | 45 | } |
| 46 | + }else { | ||
| 47 | + logger.info("录像查询完成事件触发, 但是订阅为空,取消发送,deviceId:{}, channelId: {}", | ||
| 48 | + event.getRecordInfo().getDeviceId(), event.getRecordInfo().getChannelId()); | ||
| 46 | } | 49 | } |
| 47 | } | 50 | } |
| 48 | 51 | ||
| @@ -53,6 +56,7 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | @@ -53,6 +56,7 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | ||
| 53 | * @param recordEndEventHandler | 56 | * @param recordEndEventHandler |
| 54 | */ | 57 | */ |
| 55 | public void addEndEventHandler(String device, String channelId, RecordEndEventHandler recordEndEventHandler) { | 58 | public void addEndEventHandler(String device, String channelId, RecordEndEventHandler recordEndEventHandler) { |
| 59 | + logger.info("录像查询事件添加监听,deviceId:{}, channelId: {}", device, channelId); | ||
| 56 | handlerMap.put(device + channelId, recordEndEventHandler); | 60 | handlerMap.put(device + channelId, recordEndEventHandler); |
| 57 | } | 61 | } |
| 58 | /** | 62 | /** |
| @@ -61,6 +65,7 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | @@ -61,6 +65,7 @@ public class RecordEndEventListener implements ApplicationListener<RecordEndEven | ||
| 61 | * @param channelId | 65 | * @param channelId |
| 62 | */ | 66 | */ |
| 63 | public void delEndEventHandler(String device, String channelId) { | 67 | public void delEndEventHandler(String device, String channelId) { |
| 68 | + logger.info("录像查询事件移除监听,deviceId:{}, channelId: {}", device, channelId); | ||
| 64 | handlerMap.remove(device + channelId); | 69 | handlerMap.remove(device + channelId); |
| 65 | } | 70 | } |
| 66 | 71 |