You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@apache.org> on 2009/04/01 09:59:32 UTC

Re: [Client API] Ldap connection object

Stefan Seelmann wrote:
> It would be cool configure a connection with default parameters, that
> are used as default for operations. For example the connection could be
> configured with a default search size limit that is used for each search
> request (but could be overwritten of course).
>   
Totally agree. One other thing we _must_ have is a connection pooling 
mechanism.
> Some methods I have in mind:
>
> setDefaultSearchSizeLimit(int)
> setDefaultSearchTimeLimit(int)
> setDefaultSearchScope(some Enum)
> setDefaultSearchBase(String dn / LdapDN dn)
> setDefaultSearchAttributes(String..attributes)
>
> setDefaultDerefAliasMethod(some Enum)
> setDefaultReferralsHandlingMethod(some Enum)
>   
Yeah, definitively a good idea. I will add those methods to the 
connection class.
> I think for controls it makes sense to define them per operation type
> because most controls only make sense for a specific operations:
> setDefaultSearchControls(Controls..controls) - like paged search
> setDefaultDeleteControls(Controls..controls) - like tree delete control
> etc.
>   
Well, I think that it's better to have the Controls added to each 
operation object, like BindRequest, SearchRequest...

For instance, you do a
BindRequest br = new BindRequest();
...
br.addControl( c1 );

Then you call the bind method :

connection.bind( br );

The addControl can use varargs, so you can do addControl( c1, c2, ...)

wdyt ?


-- 
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org