BBjLDAPEntry

Description

Contains the information for a single entry in an LDAP directory. These objects are retrieved using a search query (see BBjLDAPConnection::search).

Creation

Obtain a list of BBjLDAPEntry objects through the following BBjLDAPSearchResult method:

Return Value

Method

BBjVector

getSearchEntries()

Methods of BBjLDAPEntry

Return Value

Method

void

addAttribute(string name, string values)

void

addAttributes(string name, BBjVector values)

BBjVector

getAttributeNames()

string

getAttributeValue(string name)

BBjVector

getAttributeValues(string name)

string

getDN()

Remarks

None.

Constants

None.

Example

REM ' BBjLDAPEntry sample 1

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

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

use com.basis.bbj.proxies.ldap.BBjLDAPEntry

declare BBjLDAPConnection ldapCon!

declare BBjLDAPSearchResult searchResults!

declare BBjVector entries!

declare BBjVector attrs!

declare BBjLDAPEntry entry!

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

Using LDAP and Active Directory User Authentication

Object Variables

BBj Object Assignment

BBj Object Error Handling

BBj Object Operators

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




______________________________________________________________________________________

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