mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
27.28.2013 617b205225d505fc6a17d792b2d3d183aa080321
opendj3/opendj-ldap-sdk/src/main/java/org/forgerock/opendj/ldap/requests/Requests.java
@@ -22,7 +22,7 @@
 *
 *
 *      Copyright 2010 Sun Microsystems, Inc.
 *      Portions copyright 2011-2012 ForgeRock AS
 *      Portions copyright 2011-2013 ForgeRock AS
 */
package org.forgerock.opendj.ldap.requests;
@@ -1017,7 +1017,7 @@
    /**
     * Creates a new search request using the provided distinguished name,
     * scope, and filter, decoded using the default schema.
     * scope, and filter.
     *
     * @param name
     *            The distinguished name of the base entry relative to which the
@@ -1079,6 +1079,58 @@
    }
    /**
     * Creates a new search request for a single entry, using the provided distinguished name,
     * scope, and filter.
     *
     * @param name
     *            The distinguished name of the base entry relative to which the
     *            search is to be performed.
     * @param scope
     *            The scope of the search.
     * @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.
     * @return The new search request.
     * @throws NullPointerException
     *             If the {@code name}, {@code scope}, or {@code filter} were
     *             {@code null}.
     */
    public static SearchRequest newSingleEntrySearchRequest(final DN name, final SearchScope scope,
            final Filter filter, final String... attributeDescriptions) {
        return newSearchRequest(name, scope, filter, attributeDescriptions).setSizeLimit(1);
    }
    /**
     * Creates a new search request for a single entry, using the provided distinguished name,
     * scope, and filter, decoded using the default schema.
     *
     * @param name
     *            The distinguished name of the base entry relative to which the
     *            search is to be performed.
     * @param scope
     *            The scope of the search.
     * @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.
     * @return The new search request.
     * @throws LocalizedIllegalArgumentException
     *             If {@code name} could not be decoded using the default
     *             schema, or if {@code filter} is not a valid LDAP string
     *             representation of a filter.
     * @throws NullPointerException
     *             If the {@code name}, {@code scope}, or {@code filter} were
     *             {@code null}.
     */
    public static SearchRequest newSingleEntrySearchRequest(final String name, final SearchScope scope,
            final String filter, final String... attributeDescriptions) {
        return newSearchRequest(name, scope, filter, attributeDescriptions).setSizeLimit(1);
    }
    /**
     * Creates a new simple bind request having an empty name and password
     * suitable for anonymous authentication.
     *