From 7b3f2a57a2e54132a8bc678aa552a669e7915c80 Mon Sep 17 00:00:00 2001 From: shikong <919411476@qq.com> Date: Tue, 3 Oct 2023 03:45:47 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E7=94=A8=E8=AE=A2=E9=98=85=E5=99=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20compile=20=E6=96=B9=E6=B3=95=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gb28181/core/sip/message/subscribe/GenericSubscribe.java | 2 ++ .../gb28181/core/sip/message/subscribe/InviteSubscribe.java | 4 ++++ .../core/sip/message/subscribe/RecordInfoSubscribe.java | 4 ++++ .../core/sip/message/subscribe/SipRequestSubscribe.java | 4 ++++ .../core/sip/message/subscribe/SipResponseSubscribe.java | 4 ++++ .../skcks/docking/gb28181/service/catalog/CatalogService.java | 3 ++- 6 files changed, 20 insertions(+), 1 deletion(-) diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/GenericSubscribe.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/GenericSubscribe.java index b205efd..3c7a8af 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/GenericSubscribe.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/GenericSubscribe.java @@ -19,6 +19,8 @@ public interface GenericSubscribe { void addSubscribe(String key,Flow.Subscriber subscribe); void delPublisher(String key); + void compile(String key); + class Helper { public final static String SEPARATOR = ":"; public static String getKey(String prefix,String... ids){ diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/InviteSubscribe.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/InviteSubscribe.java index 5e6e839..9fc7ed1 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/InviteSubscribe.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/InviteSubscribe.java @@ -30,6 +30,10 @@ public class InviteSubscribe implements GenericSubscribe { Helper.addSubscribe(publishers, key, subscribe); } + public void compile(String key){ + delPublisher(key); + } + @Override public void delPublisher(String key) { Helper.delPublisher(publishers, key); diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/RecordInfoSubscribe.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/RecordInfoSubscribe.java index 8206d01..92ffc50 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/RecordInfoSubscribe.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/RecordInfoSubscribe.java @@ -30,6 +30,10 @@ public class RecordInfoSubscribe implements GenericSubscribe, Helper.addSubscribe(publishers, key, subscribe); } + public void compile(String key){ + delPublisher(key); + } + @Override public void delPublisher(String key) { ScheduledFuture schedule = scheduledFutureManager.remove(key); diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipResponseSubscribe.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipResponseSubscribe.java index 22d19e2..1caa348 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipResponseSubscribe.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/core/sip/message/subscribe/SipResponseSubscribe.java @@ -33,6 +33,10 @@ public class SipResponseSubscribe implements GenericTimeoutSubscribe schedule = scheduledFutureManager.remove(key); diff --git a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/catalog/CatalogService.java b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/catalog/CatalogService.java index 8269a0a..b1617f3 100644 --- a/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/catalog/CatalogService.java +++ b/gb28181-service/src/main/java/cn/skcks/docking/gb28181/service/catalog/CatalogService.java @@ -85,7 +85,7 @@ public class CatalogService { data.addAll(catalogResponseDTO.getDeviceList().getDeviceList()); if(curNum >= sumNum){ log.info("获取完成 {}", key); - subscribe.getSipRequestSubscribe().delPublisher(key); + subscribe.getSipRequestSubscribe().compile(key); } else { subscription.request(1); } @@ -100,6 +100,7 @@ public class CatalogService { @Override public void onComplete() { log.info("{} 返回结果 {}", key, result.complete(data)); + subscribe.getSipRequestSubscribe().delPublisher(key); } }); provider.sendRequest(request);