Interface LDAPSearchResult

    • Method Detail

      • getCount

        int getCount()
        Returns the number of matching entries for the search operation.
        Returns:
        the number of matching entries for the search operation.
      • getEntry

        LDAPEntry getEntry()
                    throws LDAPException
        Returns the single matching entry returned for the search operation.

        Note that if the search result contains more than one entry, an LDAPException will be thrown. It is recommended to check the result count before making calls of this method. In case there will be more than one entry returned for the search operation, use entries iterator instead.

        Returns:
        the single matching entry returned for the search operation, or null if no entries returned for the search operation.
        Throws:
        LDAPException - if more than one entry returned for the search operation.
      • getEntry

        LDAPEntry getEntry​(String dn)
                    throws LDAPException
        Returns the matching entry with the specified DN from the set of entries for the search operation.
        Parameters:
        dn - the DN of the entry to retrieve from the set of matching entries returned for the search operation. It must not be null.
        Returns:
        the matching entry with the provided DN, or null if the specified entry was not returned for the search operation.
        Throws:
        LDAPException - if failed to parse the provided DN or a search entry DN.
      • getFirstEntry

        LDAPEntry getFirstEntry()
        Returns the first entry from the set of entries for the search operation.

        Note that this method was added for convenience and should be used with care, only when the number / order of matching entries for the search operation is irrelevant. In other cases, use either getEntry() for expected single matching entry result or entriesIterator() if more than one entry result expected.

        Returns:
        the first entry from the set of entries returned for the search operation, or null if no entries returned for the search operation.
        See Also:
        getEntry(), entriesIterator()
      • entriesIterator

        Iterator<LDAPEntry> entriesIterator()
        Returns an iterator over the set of the matching entries for the search operation.
        Returns:
        an iterator over the set of the matching entries for the search operation.