Name

Control

Synopsis

A Control is used as a modifier to alter the way in which an LDAP server satisfies requests, and to mark responses back from the LDAP server. Controls can be created using the ControlFactory interface, but more typically an LDAP provider will provide concrete subclasses of Control that provide specific modifiers. Sun’s LDAP JNDI provider, for example, includes the com.sun.jndi.ldap.ctl.SortControl, which allows you to request that the LDAP server sort the results of searches according to a set of criteria. There is not a standard set of Controls that all LDAP servers must support, so you’ll need to consult the documentation for your particular LDAP JNDI provider and LDAP server to see what options you have.

There are two kinds of Controls that can be set on LdapContexts. Connection request controls affect how LDAP connections are made, and are set when an LdapContext is first created. They can also be changed by calling the LdapContext.reconnect() method, and retrieved by calling LdapContext.getConnectControls(). Context request controls affect the behavior of context-related methods, and are set using the LdapRequestControls.setRequestControls() method.

                  Exceptions
public interface Control extends Serializable {
// Public Constants
   public static final boolean CRITICAL;                         // =true
   public static final boolean NONCRITICAL;                      // =false
                  // Public Instance Methods public abstract ...

Get Java Enterprise in a Nutshell, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.