BBjLDAPSearchResult::getEntryCount


Description

In BBj 11.0 and higher, this method returns the number of entries that matched the search criteria use to generate the BBjLDAPSearchResult object.

Syntax

Return Value

Method

int

getEntryCount()

Parameters

None.

Return Value

Returns the number of entries returned by the search request.

Remarks

None.

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 searchResults!.getEntryCount() - 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

BBjLDAPSearchResult

BBj Object Diagram for an illustration of the relationship between BBjObjects



______________________________________________________________________________________

Copyright BASIS International Ltd. BBj®, Visual PRO/5®, PRO/5®, and BBx® are registered trademarks.