How do I Search OpenLDAP with with many "member" attributes in an object?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Thomas_Maier
Posted On:   Monday, July 18, 2005 10:12 AM

I have a directory structure like: Object group_A with Attributes Id="member", value="uid=franz,ou=person" Id="member", value="uid=karl,ou=person" Id="member", value="uid=anna,ou=person" ... and I want to retrieve all of the members to look if a person is in a group or not. when I do Attributes atts = ctx.getAttributes("cn=group_A"); int siz = atts.size(); NamingEnumeration ne = atts.getAll(); while (ne.hasMore()){ Attribute at = (Attribute) ne.next() System.out.println("Attribute: "   More>>

I have a directory structure like:

Object group_A with Attributes

Id="member", value="uid=franz,ou=person"

Id="member", value="uid=karl,ou=person"

Id="member", value="uid=anna,ou=person"

...


and I want to retrieve all of the members to look if a
person is in a group or not.



when I do

			

Attributes atts = ctx.getAttributes("cn=group_A");

int siz = atts.size();

NamingEnumeration ne = atts.getAll();

while (ne.hasMore()){

Attribute at = (Attribute) ne.next()

System.out.println("Attribute: " + at.get());

}



I get "1" as size and only the first member out of the
three.

How can I get the other members out of the directory?    <<Less

Re: How do I Search OpenLDAP with with many "member" attributes in an object?

Posted By:   Alok_Rai  
Posted On:   Tuesday, July 19, 2005 05:43 AM

Hi Thomas



Even before the first line of code you have pasted here, you write search statement, While writing search statement use multilevel option (i.e. LDAPConnection.SCOPE_SUB)
then it will bring completer tree of records



Thanks

Alok
About | Sitemap | Contact