From 1734229125e7bad5f85dfe11d076eeda206236a9 Mon Sep 17 00:00:00 2001
From: Ludovic Poitou <ludovic.poitou@forgerock.com>
Date: Mon, 18 Oct 2010 19:41:47 +0000
Subject: [PATCH] Update from OpenDS sdk by Bo Li: Added unmodifiable and copyOf request factories. Added authrate performance utility.

---
 sdk/src/org/opends/sdk/requests/SearchRequestImpl.java |   32 ++++++++++++++++++++++++++++----
 1 files changed, 28 insertions(+), 4 deletions(-)

diff --git a/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java b/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
index a56b610..7d13fc6 100644
--- a/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
+++ b/sdk/src/org/opends/sdk/requests/SearchRequestImpl.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2009-2010 Sun Microsystems, Inc.
+ *      Copyright 2010 Sun Microsystems, Inc.
  */
 
 package org.opends.sdk.requests;
@@ -49,7 +49,8 @@
 
   private DN name;
 
-  private DereferenceAliasesPolicy dereferenceAliasesPolicy = DereferenceAliasesPolicy.NEVER;
+  private DereferenceAliasesPolicy dereferenceAliasesPolicy =
+      DereferenceAliasesPolicy.NEVER;
 
   private Filter filter;
 
@@ -75,8 +76,6 @@
    * @param filter
    *          The filter that defines the conditions that must be fulfilled in
    *          order for an entry to be returned.
-   * @param attributeDescriptions
-   *          The names of the attributes to be included with each entry.
    * @throws NullPointerException
    *           If the {@code name}, {@code scope}, or {@code filter} were
    *           {@code null}.
@@ -92,6 +91,31 @@
 
 
   /**
+   * Creates a new search request that is an exact copy of the provided
+   * request.
+   *
+   * @param searchRequest
+   *          The search request to be copied.
+   * @throws NullPointerException
+   *           If {@code searchRequest} was {@code null} .
+   */
+  SearchRequestImpl(final SearchRequest searchRequest)
+      throws NullPointerException
+  {
+    super(searchRequest);
+    this.attributes.addAll(searchRequest.getAttributes());
+    this.name = searchRequest.getName();
+    this.dereferenceAliasesPolicy = searchRequest.getDereferenceAliasesPolicy();
+    this.filter = searchRequest.getFilter();
+    this.scope = searchRequest.getScope();
+    this.sizeLimit = searchRequest.getSizeLimit();
+    this.timeLimit = searchRequest.getTimeLimit();
+    this.typesOnly = searchRequest.isTypesOnly();
+  }
+
+
+
+  /**
    * {@inheritDoc}
    */
   public SearchRequest addAttribute(final String... attributeDescriptions)

--
Gitblit v1.10.0