From bf7b61bf7e22fc0c1c0bf69255f44d0139c86937 Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Thu, 24 Aug 2006 15:50:33 +0000
Subject: [PATCH] Add a configuration option to limit the number of entries that will be checked for matches during a search operation. A value of -1 or 0 will remove the limit, like the behavior of DS 5 and 6. Changed the "unlimited" values of size and time limits to be consistent with the lookthrough limit (-1 or 0). 

---
 opends/src/server/org/opends/server/core/DirectoryServer.java |   37 +++++++++++++++++++++++++++++++++++++
 1 files changed, 37 insertions(+), 0 deletions(-)

diff --git a/opends/src/server/org/opends/server/core/DirectoryServer.java b/opends/src/server/org/opends/server/core/DirectoryServer.java
index 4d73645..8af3d3e 100644
--- a/opends/src/server/org/opends/server/core/DirectoryServer.java
+++ b/opends/src/server/org/opends/server/core/DirectoryServer.java
@@ -378,6 +378,10 @@
   // unless overridden on a per-user basis.
   private int timeLimit;
 
+  // The maxiumum number of candidates that should be check for matches during
+  // a search.
+  private int lookthroughLimit;
+
   // The key manager provider for the Directory Server.
   private KeyManagerProvider keyManagerProvider;
 
@@ -7133,6 +7137,39 @@
 
 
   /**
+   * Retrieves the default maximum number of entries that should checked for
+   * matches during a search.
+   *
+   * @return  The default maximum number of entries that should checked for
+   *          matches during a search.
+   */
+  public static int getLookthroughLimit()
+  {
+    assert debugEnter(CLASS_NAME, "getLookthroughLimit");
+
+    return directoryServer.lookthroughLimit;
+  }
+
+
+
+  /**
+   * Specifies the default maximum number of entries that should be checked for
+   * matches during a search.
+   *
+   * @param  lookthroughLimit  The default maximum number of entries that should
+   *                           be check for matches during a search.
+   */
+  public static void setLookthroughLimit(int lookthroughLimit)
+  {
+    assert debugEnter(CLASS_NAME, "setLookthroughLimit",
+      String.valueOf(lookthroughLimit));
+
+    directoryServer.lookthroughLimit = lookthroughLimit;
+  }
+
+
+
+  /**
    * Retrieves the default maximum length of time in seconds that should be
    * allowed when processing a search.
    *

--
Gitblit v1.10.0