From 3962352ec32137e9561c2ba16e192f1f7fdebade Mon Sep 17 00:00:00 2001 From: 648540858 <648540858@qq.com> Date: Wed, 15 Dec 2021 11:07:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96zlm=E7=8A=B6=E6=80=81?= =?UTF-8?q?=E5=8F=98=E5=8C=96=E4=BA=8B=E4=BB=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../vmp/media/zlm/ZLMHttpHookListener.java | 1 - .../zlm/event/ZLMOfflineEventListener.java | 42 ------------------- ...tener.java => ZLMStatusEventListener.java} | 28 +++++++++---- 3 files changed, 21 insertions(+), 50 deletions(-) delete mode 100644 src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMOfflineEventListener.java rename src/main/java/com/genersoft/iot/vmp/media/zlm/event/{ZLMOnlineEventListener.java => ZLMStatusEventListener.java} (66%) diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java index 7eac768a..b6af955a 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/ZLMHttpHookListener.java @@ -444,7 +444,6 @@ public class ZLMHttpHookListener { } return new ResponseEntity(ret.toString(),HttpStatus.OK); } - } /** diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMOfflineEventListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMOfflineEventListener.java deleted file mode 100644 index a8b0e43b..00000000 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMOfflineEventListener.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.genersoft.iot.vmp.media.zlm.event; - -import com.genersoft.iot.vmp.conf.UserSetup; -import com.genersoft.iot.vmp.service.IMediaServerService; -import com.genersoft.iot.vmp.service.IStreamProxyService; -import com.genersoft.iot.vmp.service.IStreamPushService; -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; -import com.genersoft.iot.vmp.utils.redis.RedisUtil; -import org.slf4j.Logger; -import org.slf4j.LoggerFactory; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.ApplicationListener; -import org.springframework.stereotype.Component; - -/** - * - */ -@Component -public class ZLMOfflineEventListener implements ApplicationListener { - - private final static Logger logger = LoggerFactory.getLogger(ZLMOfflineEventListener.class); - - @Autowired - private IMediaServerService mediaServerService; - - @Autowired - private IStreamPushService streamPushService; - - @Autowired - private IStreamProxyService streamProxyService; - - @Override - public void onApplicationEvent(ZLMOfflineEvent event) { - - logger.info("ZLM离线事件触发,ID:" + event.getMediaServerId()); - // 处理ZLM离线 - mediaServerService.zlmServerOffline(event.getMediaServerId()); - streamProxyService.zlmServerOffline(event.getMediaServerId()); - streamPushService.zlmServerOffline(event.getMediaServerId()); - // TODO 处理对国标的影响 - } -} diff --git a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMOnlineEventListener.java b/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMStatusEventListener.java similarity index 66% rename from src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMOnlineEventListener.java rename to src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMStatusEventListener.java index 952a673c..5b0741b6 100644 --- a/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMOnlineEventListener.java +++ b/src/main/java/com/genersoft/iot/vmp/media/zlm/event/ZLMStatusEventListener.java @@ -1,16 +1,14 @@ package com.genersoft.iot.vmp.media.zlm.event; -import com.genersoft.iot.vmp.conf.SipConfig; -import com.genersoft.iot.vmp.conf.UserSetup; import com.genersoft.iot.vmp.service.IMediaServerService; import com.genersoft.iot.vmp.service.IStreamProxyService; import com.genersoft.iot.vmp.service.IStreamPushService; -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; -import com.genersoft.iot.vmp.utils.redis.RedisUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.ApplicationListener; +import org.springframework.context.event.EventListener; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import java.text.SimpleDateFormat; @@ -23,9 +21,9 @@ import java.text.SimpleDateFormat; * @date: 2020年5月6日 下午1:51:23 */ @Component -public class ZLMOnlineEventListener implements ApplicationListener { +public class ZLMStatusEventListener { - private final static Logger logger = LoggerFactory.getLogger(ZLMOnlineEventListener.class); + private final static Logger logger = LoggerFactory.getLogger(ZLMStatusEventListener.class); @Autowired private IStreamPushService streamPushService; @@ -33,9 +31,13 @@ public class ZLMOnlineEventListener implements ApplicationListener