BBjLDAPSearchResult::getSearchEntries

Description

In BBj 11.00 and higher, this method returns a list of the entries that match the search criteria used to generate the BBjLDAPSearchResult object.

Syntax

Return Value Method
BBjVector getSearchEntries()

Parameters

None.

Return Value

Returns a BBjVector containing a list of BBjLDAPEntry objects - one for each entry in the result.

Example

rem ' getLDAPConnection sample 1

use com.basis.bbj.proxies.ldap.BBjLDAPSearchResult
use com.basis.bbj.proxies.ldap.BBjLDAPConnection

declare BBjLDAPConnection ldapCon!
declare BBjLDAPSearchResult searchResults!
declare BBjVector entries!
declare BBjVector attrs!

rem 'Get a connection to a specific LDAP server
host$ = "localhost"
port = 10389
authDN$ = "uid=admin,ou=system"
pwd$ = "secret"
ldapCon! = BBjAPI().getLDAPConnection(host$, port, authDN$, pwd$)

rem 'return a list of all immediate children of the ou=system object

searchResults! =
ldapCon!.search("ou=system",BBjLDAPSearchResult.SCOPE_ONE, 100,
100, "(objectClass=*)")
entries! = searchResults!.getSearchEntries()
for e = 0 to entries!.size() - 1
    entry! = entries!.getItem(e)
    print "ENTRY - dn: " + entry!.getDN()
    attrs! = entry!.getAttributeNames()
    for i = 0 to attrs!.size() - 1
        attr$ = attrs!.getItem(i)
        print "     " + attr$
    next i
next e

rem 'Unbind and close the connection
ldapCon!.close()

See Also

BBjAPI

BBjLDAPConnection

See the BBj Object Diagram for an illustration of the relationship between BBj Objects.