directory-api mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Lecharny <>
Subject Re: Implementing Ldap Persistent search using apache directory api
Date Sun, 17 Apr 2011 19:47:42 GMT
On 4/17/11 6:35 PM, Narendra Kadali wrote:
> Hi All,
> I am new to this apache directory api and there is no documentation available.
The documentation effort is currently being conducted.

> I need to implement directory persistance search using this api.
This is pretty simple.
> Can any one give me sample code for implementing my scenario or any refrences for doing
Persistent search is just a normal search except that you pass the 
PersistentSearch control with the search request.
The search operation is explained on

Adding a control can be done following this sample :

         Control psearchControl = new PersistentSearchImpl();
         SearchRequest sr = new SearchRequestImpl();
         sr.setBase( new Dn( "ou=system" ) );
         sr.setFilter( "(objectclass=*" );
         sr.setScope( SearchScope.SUBTREE );
         sr.addControl( psearchControl );

         SearchCursor results = sr );

then process the entries.

You will also have to set the connection timeout to 0, otherwise it 
won't last longer than 30 seconds.

Hope it helps.

Emmanuel L├ęcharny

View raw message