From 89a9ab4534f10a224f70e546db838423e84a1965 Mon Sep 17 00:00:00 2001
From: 64850858 <648540858@qq.com>
Date: 星期五, 16 七月 2021 16:34:51 +0800
Subject: [PATCH] 添加zlm集群支持

---
 src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java |   38 ++++++++++++++++++--------------------
 1 files changed, 18 insertions(+), 20 deletions(-)

diff --git a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
index 1c6409f..eafb8a0 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/impl/RedisCatchStorageImpl.java
@@ -1,9 +1,12 @@
 package com.genersoft.iot.vmp.storager.impl;
 
+import com.alibaba.fastjson.JSONObject;
 import com.genersoft.iot.vmp.common.StreamInfo;
 import com.genersoft.iot.vmp.common.VideoManagerConstants;
 import com.genersoft.iot.vmp.media.zlm.ZLMServerConfig;
 import com.genersoft.iot.vmp.gb28181.bean.*;
+import com.genersoft.iot.vmp.media.zlm.dto.IMediaServerItem;
+import com.genersoft.iot.vmp.media.zlm.dto.MediaServerItem;
 import com.genersoft.iot.vmp.storager.IRedisCatchStorage;
 import com.genersoft.iot.vmp.storager.dao.DeviceChannelMapper;
 import com.genersoft.iot.vmp.utils.redis.RedisUtil;
@@ -84,26 +87,6 @@
                 channelId));
         if (playLeys == null || playLeys.size() == 0) return null;
         return (StreamInfo)redis.get(playLeys.get(0).toString());
-    }
-
-    /**
-     * 鏇存柊娴佸獟浣撲俊鎭�
-     * @param ZLMServerConfig
-     * @return
-     */
-    @Override
-    public boolean updateMediaInfo(ZLMServerConfig ZLMServerConfig) {
-        ZLMServerConfig.setUpdateTime(format.format(new Date(System.currentTimeMillis())));
-        return redis.set(VideoManagerConstants.MEDIA_SERVER_PREFIX, ZLMServerConfig);
-    }
-
-    /**
-     * 鑾峰彇娴佸獟浣撲俊鎭�
-     * @return
-     */
-    @Override
-    public ZLMServerConfig getMediaInfo() {
-        return (ZLMServerConfig)redis.get(VideoManagerConstants.MEDIA_SERVER_PREFIX);
     }
 
     @Override
@@ -293,4 +276,19 @@
             }
         }
     }
+
+    @Override
+    public void outlineForAll() {
+        List<Object> onlineDevices = redis.scan(VideoManagerConstants.KEEPLIVEKEY_PREFIX + "*" );
+        for (int i = 0; i < onlineDevices.size(); i++) {
+            String key = (String) onlineDevices.get(i);
+            redis.del(key);
+        }
+    }
+
+    @Override
+    public void updateWVPInfo(JSONObject jsonObject) {
+
+    }
+
 }

--
Gitblit v1.8.0