A View into Options

If you want to set a default option for a connection object, use the setOption method of LDAP-Connection. Once the option has been set, any operations with this connection will use this option, unless you specifically override the option by supplying a constraints object when invoking the operation. The setOption method takes an integer argument to indicate which option is being set, and an Object argument for the value. The constant integer values for options are defined in LDAPConnection. Settings that are not Object arguments must be wrapped in an Object when calling setOption. For example, to set the maximum number of search results to return on any operation, you can use the following code:

 ldc.setOption( ldc.SIZELIMIT, ...

Get LDAP Programming with Java™ now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.