From d739bfa5976e36ced26f906ab16f83c20c8cb27c Mon Sep 17 00:00:00 2001 From: xiaoxie <hotcoffie@163.com> Date: 星期一, 23 五月 2022 09:44:21 +0800 Subject: [PATCH] 处理冲突 --- src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java | 47 +++++++++++++++++++++++------------------------ 1 files changed, 23 insertions(+), 24 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..eaf674f 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 @@ -1,7 +1,7 @@ package com.genersoft.iot.vmp.gb28181.event; import com.genersoft.iot.vmp.gb28181.bean.*; -import com.genersoft.iot.vmp.gb28181.event.offline.OfflineEvent; +import com.genersoft.iot.vmp.gb28181.event.device.RequestTimeoutEvent; import com.genersoft.iot.vmp.gb28181.event.platformKeepaliveExpire.PlatformKeepaliveExpireEvent; import com.genersoft.iot.vmp.gb28181.event.platformNotRegister.PlatformCycleRegisterEvent; import com.genersoft.iot.vmp.gb28181.event.platformNotRegister.PlatformNotRegisterEvent; @@ -11,12 +11,11 @@ import com.genersoft.iot.vmp.media.zlm.event.ZLMOnlineEvent; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationEventPublisher; -import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEvent; -import com.genersoft.iot.vmp.gb28181.event.online.OnlineEvent; +import javax.sip.TimeoutEvent; import java.util.ArrayList; import java.util.HashSet; import java.util.List; @@ -32,20 +31,6 @@ @Autowired private ApplicationEventPublisher applicationEventPublisher; - - public void onlineEventPublish(Device device, String from) { - OnlineEvent onEvent = new OnlineEvent(this); - onEvent.setDevice(device); - onEvent.setFrom(from); - applicationEventPublisher.publishEvent(onEvent); - } - - public void outlineEventPublish(String deviceId, String from){ - OfflineEvent outEvent = new OfflineEvent(this); - outEvent.setDeviceId(deviceId); - outEvent.setFrom(from); - applicationEventPublisher.publishEvent(outEvent); - } /** * 骞冲彴蹇冭烦鍒版湡浜嬩欢 @@ -99,14 +84,27 @@ 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 + + public void requestTimeOut(TimeoutEvent timeoutEvent) { + RequestTimeoutEvent requestTimeoutEvent = new RequestTimeoutEvent(this); + requestTimeoutEvent.setTimeoutEvent(timeoutEvent); + applicationEventPublisher.publishEvent(requestTimeoutEvent); + } + + + /** + * + * @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 +126,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 +135,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