directory-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Karasulu <aok...@bellsouth.net>
Subject Re: [apacheds] How to get the whole entries?
Date Thu, 21 Jul 2005 15:22:32 GMT
Cimballi wrote:

>I don't know about ApacheDS but when you ask the server for the empty DN, it
>should return you the RootDSE.
>In the RootDSE, there is an attribute (called something like managedContexts)
>which hold the DNs of the root entries of the directory (there can be multiple
>root entries). Then you can make a search on these entries with subtree scope
>to get all subentries.
>
>  
>
Yes ApacheDS will serve up the RootDSE and you are correct.

>On 7/21/05, Trustin Lee <trustin@gmail.com> wrote:
>  
>
>>Hi all,
>>
>> I'm trying to get the list of the whole entries in DIT like this:
>>
>>         SearchControls ctrl = new SearchControls();
>>         ctrl.setSearchScope( SearchControls.SUBTREE_SCOPE );
>>         NamingEnumeration e =
>>ctx.getFactoryConfiguration().getPartitionNexus().search(
>>                 new LdapName( "" ),
>>                 ctx.getFactoryConfiguration().getEnvironment(),
>>                 new PresenceNode( "objectClass" ), ctrl );
>>
>>But this fails because ApacheDS cannot find an entry without a name:
>>
>>    
>>
An LDAP directory can master several disconnected trees.  Hence it is 
not one big tree.  For example I may have the following subtrees served 
by the server:

dc=example,dc=com
dc=apache,dc=org
dc=safehaus,dc=org

All these contexts represent separate separate trees of entrys which you 
cannot search from the root.  A DSA (Directory Server Agent) will list 
these contexts in the RootDSE in a multivalued operational attribute 
called 'namingContexts'. 

You need to list these contexts within the RootDSE and search each 
separately using a subtree scope search.

HTH,
Alex 

>> SEVERE: Unexpected exception.
>> org.apache.ldap.common.exception.LdapNameNotFoundException
>>         at
>>org.apache.ldap.server.partition.DefaultContextPartitionNexus.search(DefaultContextPartitionNexus.java:574)
>>
>> Any ideas?
>>
>> Trustin
>>--
>>what we call human nature is actually human habit
>>--
>>http://gleamynode.net/
>>    
>>
>
>
>
>  
>


Mime
View raw message