From a0537d74df5b9c8ee65dba7c4e5bc6da7fc3d031 Mon Sep 17 00:00:00 2001 From: mk1990 <37614016+mk1990@users.noreply.github.com> Date: 星期四, 28 四月 2022 16:32:09 +0800 Subject: [PATCH] Merge branch '648540858:wvp-28181-2.0' into wvp-28181-2.0 --- src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java | 33 ++++++++++++++++++++++++--------- 1 files changed, 24 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java b/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java index 1ab5312..ffe477f 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java @@ -33,12 +33,20 @@ @Autowired private ApplicationEventPublisher applicationEventPublisher; + public void onlineEventPublish(Device device, String from, int expires) { + OnlineEvent onEvent = new OnlineEvent(this); + onEvent.setDevice(device); + onEvent.setFrom(from); + onEvent.setExpires(expires); + applicationEventPublisher.publishEvent(onEvent); + } + public void onlineEventPublish(Device device, String from) { OnlineEvent onEvent = new OnlineEvent(this); onEvent.setDevice(device); onEvent.setFrom(from); - applicationEventPublisher.publishEvent(onEvent); - } + applicationEventPublisher.publishEvent(onEvent); + } public void outlineEventPublish(String deviceId, String from){ OfflineEvent outEvent = new OfflineEvent(this); @@ -99,14 +107,20 @@ applicationEventPublisher.publishEvent(outEvent); } - @Async + public void catalogEventPublish(String platformId, DeviceChannel deviceChannel, String type) { List<DeviceChannel> deviceChannelList = new ArrayList<>(); deviceChannelList.add(deviceChannel); catalogEventPublish(platformId, deviceChannelList, type); } - @Async + + /** + * + * @param platformId + * @param deviceChannels + * @param type + */ public void catalogEventPublish(String platformId, List<DeviceChannel> deviceChannels, String type) { CatalogEvent outEvent = new CatalogEvent(this); List<DeviceChannel> channels = new ArrayList<>(); @@ -128,8 +142,8 @@ applicationEventPublisher.publishEvent(outEvent); } - @Async - public void catalogEventPublishForStream(String platformId, GbStream[] gbStreams, String type) { + + public void catalogEventPublishForStream(String platformId, List<GbStream> gbStreams, String type) { CatalogEvent outEvent = new CatalogEvent(this); outEvent.setGbStreams(gbStreams); outEvent.setType(type); @@ -137,10 +151,11 @@ applicationEventPublisher.publishEvent(outEvent); } - @Async + public void catalogEventPublishForStream(String platformId, GbStream gbStream, String type) { - GbStream[] gbStreams = {gbStream}; - catalogEventPublishForStream(platformId, gbStreams, type); + List<GbStream> gbStreamList = new ArrayList<>(); + gbStreamList.add(gbStream); + catalogEventPublishForStream(platformId, gbStreamList, type); } public void recordEndEventPush(RecordInfo recordInfo) { -- Gitblit v1.8.0