From 016502d22e0490ed8b1b4951f5e12be01c4a224c Mon Sep 17 00:00:00 2001
From: Valery Kharseko <vharseko@3a-systems.ru>
Date: Mon, 03 Aug 2026 16:13:03 +0000
Subject: [PATCH] [#807] Do not drop persistent search notifications through search-phase dedup (#812)

---
 opendj-server-legacy/src/main/java/org/opends/server/api/ClientConnection.java |   23 ++++++++++++++++++++++-
 1 files changed, 22 insertions(+), 1 deletions(-)

diff --git a/opendj-server-legacy/src/main/java/org/opends/server/api/ClientConnection.java b/opendj-server-legacy/src/main/java/org/opends/server/api/ClientConnection.java
index a891fee..376578b 100644
--- a/opendj-server-legacy/src/main/java/org/opends/server/api/ClientConnection.java
+++ b/opendj-server-legacy/src/main/java/org/opends/server/api/ClientConnection.java
@@ -13,7 +13,7 @@
  *
  * Copyright 2006-2009 Sun Microsystems, Inc.
  * Portions Copyright 2011-2016 ForgeRock AS.
- * Portions Copyright 2025 3A Systems, LLC.
+ * Portions Copyright 2025-2026 3A Systems, LLC.
  */
 package org.opends.server.api;
 
@@ -656,6 +656,27 @@
     return persistentSearches;
   }
 
+  /**
+   * Indicates whether a persistent search is registered on this connection for the provided message
+   * ID. A persistent search outlives the operation which started it: that operation leaves the set
+   * of operations in progress as soon as its search phase is over, but the server can still have a
+   * final response to send for it, when the search is terminated on the server side.
+   *
+   * @param  messageID  The message ID to look for.
+   * @return  {@code true} if a persistent search is registered for the provided message ID.
+   */
+  protected final boolean hasPersistentSearch(int messageID)
+  {
+    for (PersistentSearch psearch : persistentSearches)
+    {
+      if (psearch.getMessageID() == messageID)
+      {
+        return true;
+      }
+    }
+    return false;
+  }
+
 
 
   /**

--
Gitblit v1.10.0