648540858
2022-03-01 29191373aa1e8940d3ca6ce5a052182f99b37ba9
src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java
@@ -1,12 +1,11 @@
package com.genersoft.iot.vmp.gb28181.event;
import com.genersoft.iot.vmp.gb28181.bean.Device;
import com.genersoft.iot.vmp.gb28181.bean.DeviceChannel;
import com.genersoft.iot.vmp.gb28181.bean.GbStream;
import com.genersoft.iot.vmp.gb28181.bean.*;
import com.genersoft.iot.vmp.gb28181.event.offline.OfflineEvent;
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;
import com.genersoft.iot.vmp.gb28181.event.record.RecordEndEvent;
import com.genersoft.iot.vmp.gb28181.event.subscribe.catalog.CatalogEvent;
import com.genersoft.iot.vmp.media.zlm.event.ZLMOfflineEvent;
import com.genersoft.iot.vmp.media.zlm.event.ZLMOnlineEvent;
@@ -15,7 +14,6 @@
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;
import com.genersoft.iot.vmp.gb28181.bean.DeviceAlarm;
import com.genersoft.iot.vmp.gb28181.event.alarm.AlarmEvent;
import com.genersoft.iot.vmp.gb28181.event.online.OnlineEvent;
@@ -101,14 +99,14 @@
      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 catalogEventPublish(String platformId, List<DeviceChannel> deviceChannels, String type) {
      CatalogEvent outEvent = new CatalogEvent(this);
      List<DeviceChannel> channels = new ArrayList<>();
@@ -130,8 +128,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);
@@ -139,9 +137,17 @@
      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) {
      RecordEndEvent outEvent = new RecordEndEvent(this);
      outEvent.setRecordInfo(recordInfo);
      applicationEventPublisher.publishEvent(outEvent);
   }
}