Interface LDAPSearchRequest

  • All Superinterfaces:
    Cloneable, LDAPRequest

    public interface LDAPSearchRequest
    extends LDAPRequest
    Represents an LDAP search request, which can be used to perform an LDAPv3 search operation to retrieve entries that match a given set of criteria.

    Note that LDAPSearchRequest objects should not be considered thread-safe, thus should not be used concurrently by multiple threads. Each thread wishing to process a request should have its own instance of that request.

    • Method Detail

      • clone

        LDAPSearchRequest clone()
        Creates and returns a copy of this search request that may be modified without impacting this request.
        Specified by:
        clone in interface LDAPRequest
        Returns:
        A copy of this search request that may be modified without impacting this request.
      • getBase

        String getBase()
        Returns the base distinguished name for this search request.
        Returns:
        the base distinguished name for this search request.
      • setBase

        LDAPSearchRequest setBase​(String base)
        Sets the base distinguished name for this search request.
        Parameters:
        base - the base distinguished name for this search request. It must not be null.
        Returns:
        this search request.
      • getScope

        LDAPSearchScope getScope()
        Returns the scope for this search request.
        Returns:
        the scope for this search request.
      • setScope

        LDAPSearchRequest setScope​(LDAPSearchScope scope)
        Sets the scope for this search request.
        Parameters:
        scope - the scope for this search request. It must not be null.
        Returns:
        this search request.
      • getFilter

        String getFilter()
        Returns the filter for this search request.
        Returns:
        the filter for this search request.
      • setFilter

        LDAPSearchRequest setFilter​(String filter)
                             throws LDAPException
        Sets the filter for this search request.
        Parameters:
        filter - the filter for this search request. It must not be null.
        Returns:
        this search request.
        Throws:
        LDAPException - if failed to create a valid search filter for a given filter.
      • isTypesOnly

        boolean isTypesOnly()
        Returns whether the server should return only attribute names in matching entries, rather than both names and values.
        Returns:
        true if the names but not the values of the attributes should be returned in matching entries, or false if both names and values of the attributes should be returned.
      • setTypesOnly

        LDAPSearchRequest setTypesOnly​(boolean typesOnly)
        Sets whether the server should return only attribute names in matching entries, rather than both names and values.
        Parameters:
        typesOnly - true if the names but not the values of the attributes should be returned in matching entries, or false if both names and values of the attributes should be returned.
        Returns:
        this search request.
      • getSizeLimit

        int getSizeLimit()
        Returns the maximum number of entries that should be returned by the server when processing this search request.
        Returns:
        the maximum number of entries that should be returned by the server when processing this search request.
      • setSizeLimit

        LDAPSearchRequest setSizeLimit​(int sizeLimit)
        Sets the maximum number of entries that should be returned by the server when processing this search request.
        Parameters:
        sizeLimit - the maximum number of entries that should be returned by the server when processing this search request.
        Returns:
        this search request.
      • setQueryTimeout

        LDAPSearchRequest setQueryTimeout​(long timeout)
        Sets the maximum time, in milliseconds, to wait for a response from the server when processing this search request.

        A value of zero indicates that no timeout should be enforced.

        A value that is less than zero indicates that the default query timeout for the underlying connection should be used.

        Specified by:
        setQueryTimeout in interface LDAPRequest
        Parameters:
        timeout - the maximum time, in milliseconds, to wait for a response from the server when processing this search request.
        Returns:
        this search request.
      • getTimeLimit

        int getTimeLimit()
        Returns the maximum time, in seconds, that the server should spend processing this search request.
        Returns:
        the maximum time, in seconds, that the server should spend processing this search request, or zero if there is no limit.
      • setTimeLimit

        LDAPSearchRequest setTimeLimit​(int timeLimit)
        Sets the maximum time, in seconds, that the server should spend processing this search request. A value less than or equal to zero indicates that there should be no limit.

        Note that if an attempt to process a search operation fails because the time limit has been exceeded, an LDAPSearchException will be thrown.

        Parameters:
        timeLimit - the maximum time, in seconds, that the server should spend processing this search request.
        Returns:
        this search request.
      • getAttributes

        String[] getAttributes()
        Returns the set of requested attributes to include in matching entries.
        Returns:
        the set of requested attributes to include in matching entries.
      • setAttributes

        LDAPSearchRequest setAttributes​(String... attributes)
        Sets the set of requested attributes to include in matching entries. Note that all existing attributes in this search request will be cleared before setting the specified set of attributes.
        Parameters:
        attributes - the set of requested attributes to include in matching entries.
        Returns:
        this search request.