From 8f77d0c25cdd37d4cc96c923b46ae28607bae51d Mon Sep 17 00:00:00 2001 From: jiang <893224616@qq.com> Date: 星期四, 18 八月 2022 16:17:23 +0800 Subject: [PATCH] 根据redis消息更新推流列表 --- src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java index 6c33406..a48dd20 100644 --- a/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java +++ b/src/main/java/com/genersoft/iot/vmp/gb28181/transmit/event/response/impl/RegisterResponseProcessor.java @@ -7,7 +7,7 @@ import com.genersoft.iot.vmp.gb28181.transmit.cmd.ISIPCommanderForPlatform; import com.genersoft.iot.vmp.gb28181.transmit.event.response.SIPResponseProcessorAbstract; import com.genersoft.iot.vmp.storager.IRedisCatchStorage; -import com.genersoft.iot.vmp.storager.IVideoManagerStorager; +import com.genersoft.iot.vmp.storager.IVideoManagerStorage; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; @@ -26,14 +26,14 @@ @Component public class RegisterResponseProcessor extends SIPResponseProcessorAbstract { - private Logger logger = LoggerFactory.getLogger(RegisterResponseProcessor.class); - private String method = "REGISTER"; + private final Logger logger = LoggerFactory.getLogger(RegisterResponseProcessor.class); + private final String method = "REGISTER"; @Autowired private ISIPCommanderForPlatform sipCommanderForPlatform; @Autowired - private IVideoManagerStorager storager; + private IVideoManagerStorage storager; @Autowired private IRedisCatchStorage redisCatchStorage; @@ -69,11 +69,11 @@ ParentPlatformCatch parentPlatformCatch = redisCatchStorage.queryPlatformCatchInfo(platformGBId); if (parentPlatformCatch == null) { - logger.warn(String.format("鏀跺埌 %s 鐨勬敞鍐�/娉ㄩ攢%S璇锋眰, 浣嗘槸骞冲彴缂撳瓨淇℃伅鏈煡璇㈠埌!!!", platformGBId, response.getStatusCode())); + logger.warn(String.format("[鏀跺埌娉ㄥ唽/娉ㄩ攢%S璇锋眰]骞冲彴锛�%s锛屼絾鏄钩鍙扮紦瀛樹俊鎭湭鏌ヨ鍒�!!!", response.getStatusCode(),platformGBId)); return; } String action = parentPlatformCatch.getParentPlatform().getExpires().equals("0") ? "娉ㄩ攢" : "娉ㄥ唽"; - logger.info(String.format("鏀跺埌 %s %s鐨�%S鍝嶅簲", platformGBId, action, response.getStatusCode() )); + logger.info(String.format("[%s %S鍝嶅簲]%s ", action, response.getStatusCode(), platformGBId )); ParentPlatform parentPlatform = parentPlatformCatch.getParentPlatform(); if (parentPlatform == null) { logger.warn(String.format("鏀跺埌 %s %s鐨�%S璇锋眰, 浣嗘槸骞冲彴淇℃伅鏈煡璇㈠埌!!!", platformGBId, action, response.getStatusCode())); @@ -90,10 +90,12 @@ redisCatchStorage.delPlatformCatchInfo(platformGBId); // 鍙栧洖Expires璁剧疆锛岄伩鍏嶆敞閿�杩囩▼涓缃负0 ParentPlatform parentPlatformTmp = storager.queryParentPlatByServerGBId(platformGBId); - parentPlatformTmp.setStatus("娉ㄥ唽".equals(action)); - redisCatchStorage.updatePlatformRegister(parentPlatformTmp); - redisCatchStorage.updatePlatformKeepalive(parentPlatformTmp); - parentPlatformCatch.setParentPlatform(parentPlatformTmp); + if (parentPlatformTmp != null) { + parentPlatformTmp.setStatus("娉ㄥ唽".equals(action)); + redisCatchStorage.updatePlatformRegister(parentPlatformTmp); + redisCatchStorage.updatePlatformKeepalive(parentPlatformTmp); + parentPlatformCatch.setParentPlatform(parentPlatformTmp); + } redisCatchStorage.updatePlatformCatchInfo(parentPlatformCatch); storager.updateParentPlatformStatus(platformGBId, "娉ㄥ唽".equals(action)); if ("娉ㄩ攢".equals(action)) { -- Gitblit v1.8.0