directory-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel L├ęcharny <elecha...@apache.org>
Subject Re: Apache Directory LDAP client API & persistent search
Date Thu, 13 Oct 2011 22:55:35 GMT
On 10/14/11 12:33 AM, Stefan Seelmann wrote:
> On Thu, Oct 6, 2011 at 11:05 PM, Emmanuel Lecharny<elecharny@gmail.com>  wrote:
>> On 10/6/11 10:44 PM, Charles FENDT wrote:
>>> Hi,
>>>
>>> I'm trying to work with Apache DS for a central repository and Apache
>>> Directory LDAP Client API on Java servers to request in the repository.
>>> It work pretty good... except one thing : I need to make persistent sear
>>> in the LDAP server... and i can't make it work...
>>> I didn't found any example or howto on which base my code...
>>>
>>> So I'm asking for some help !
>> You may check this test :
>>
>> http://svn.apache.org/viewvc/directory/apacheds/trunk/server-integ/src/test/java/org/apache/directory/server/operations/search/PersistentSearchIT.java?revision=1124675&view=markup
>>
>> It implements a persistent search.
>>
>> Be aware that this test is a bit complex, but feel free to post your
>> question on this mailing list.
> Hm, the linked test uses JNDI to perform persistent search. Does the
> LDAP API also support persistent search and if yes are there examples?

Well, we have to inject the PersistentSearch control this way :

     @Test
     public void testSimpleSearchWithControl() throws Exception
     {
         SearchRequest searchRequest = new SearchRequestImpl().setBase( 
new Dn( "ou=system" ) ).setFilter( "(objectclass=*)" )
         .setScope( SearchScope.ONELEVEL ).addControl( new 
PersistentSearchImpl() );
         EntryCursor cursor = connection.search( "ou=system", 
"(objectclass=*)", SearchScope.ONELEVEL );

Now, we have to deal with the result. It's a bit late for me to add a 
test that does it.

-- 
Regards,
Cordialement,
Emmanuel L├ęcharny
www.iktek.com


Mime
View raw message