From f0b6debbaa18a034b2f702261b3ff07af9d92b1b 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). 

---
 opendj-sdk/opends/src/server/org/opends/server/api/ClientConnection.java |   38 ++++++++++++++++++++++++++++++++++++++
 1 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/opendj-sdk/opends/src/server/org/opends/server/api/ClientConnection.java b/opendj-sdk/opends/src/server/org/opends/server/api/ClientConnection.java
index 9f775b3..a200851 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/api/ClientConnection.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/api/ClientConnection.java
@@ -80,6 +80,9 @@
   // The time limit for use with this client connection.
   private int timeLimit;
 
+  // The lookthrough limit for use with this client connection.
+  private int lookthroughLimit;
+
   // The opaque information used for storing intermediate state
   // information needed across multi-stage SASL binds.
   private Object saslAuthState;
@@ -103,6 +106,7 @@
     persistentSearches = new CopyOnWriteArrayList<PersistentSearch>();
     sizeLimit          = DirectoryServer.getSizeLimit();
     timeLimit          = DirectoryServer.getTimeLimit();
+    lookthroughLimit   = DirectoryServer.getLookthroughLimit();
   }
 
 
@@ -776,6 +780,40 @@
 
 
   /**
+   * 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 final int getLookthroughLimit()
+  {
+    assert debugEnter(CLASS_NAME, "getLookthroughLimit");
+
+    return 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 final void setLookthroughLimit(int lookthroughLimit)
+  {
+    assert debugEnter(CLASS_NAME, "setLookthroughLimit",
+      String.valueOf(lookthroughLimit));
+
+    this.lookthroughLimit = lookthroughLimit;
+  }
+
+
+
+  /**
    * Retrieves the time limit that will be enforced for searches
    * performed using this client connection.
    *

--
Gitblit v1.10.0