panlinlin
2021-04-14 cb5849d8a14f55241c44bdf6724b18de7950564d
src/main/java/com/genersoft/iot/vmp/gb28181/event/EventPublisher.java
@@ -1,5 +1,7 @@
package com.genersoft.iot.vmp.gb28181.event;
import com.genersoft.iot.vmp.gb28181.event.platformKeepaliveExpire.PlatformKeepaliveExpireEvent;
import com.genersoft.iot.vmp.gb28181.event.platformNotRegister.PlatformNotRegisterEvent;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationEventPublisher;
import org.springframework.stereotype.Component;
@@ -33,6 +35,26 @@
      outEvent.setFrom(from);
        applicationEventPublisher.publishEvent(outEvent);
    }
   /**
    * 平台心跳到期事件
    * @param platformGbId
    */
   public void platformKeepaliveExpireEventPublish(String platformGbId){
      PlatformKeepaliveExpireEvent platformNotRegisterEvent = new PlatformKeepaliveExpireEvent(this);
      platformNotRegisterEvent.setPlatformGbID(platformGbId);
        applicationEventPublisher.publishEvent(platformNotRegisterEvent);
    }
   /**
    * 平台未注册事件
    * @param platformGbId
    */
   public void platformNotRegisterEventPublish(String platformGbId){
      PlatformNotRegisterEvent platformNotRegisterEvent = new PlatformNotRegisterEvent(this);
      platformNotRegisterEvent.setPlatformGbID(platformGbId);
        applicationEventPublisher.publishEvent(platformNotRegisterEvent);
   }
   
   /**
    * 设备报警事件
@@ -43,4 +65,5 @@
      alarmEvent.setAlarmInfo(deviceAlarm);
      applicationEventPublisher.publishEvent(alarmEvent);
   }
}