Class MutableDelegatingLdapContext

  • All Implemented Interfaces:
    javax.naming.Context, javax.naming.directory.DirContext, javax.naming.ldap.LdapContext, DirContextProxy

    public class MutableDelegatingLdapContext
    extends DelegatingLdapContext
    Used by MutablePooledContextSource to wrap a LdapContext, delegating most methods to the underlying context. This class extends DelegatingLdapContext, allowing request controls to be set on the wrapped ldap context. This enables the Spring LDAP pooling to be used for scenarios such as paged results.
    Since:
    2.0
    • Constructor Detail

      • MutableDelegatingLdapContext

        public MutableDelegatingLdapContext​(org.apache.commons.pool2.KeyedObjectPool keyedObjectPool,
                                            javax.naming.ldap.LdapContext delegateLdapContext,
                                            DirContextType dirContextType)
        Create a new mutable delegating ldap context for the specified pool, context and context type.
        Parameters:
        keyedObjectPool - The pool the delegate context was checked out from.
        delegateLdapContext - The ldap context to delegate operations to.
        dirContextType - The type of context, used as a key for the pool.
        Throws:
        java.lang.IllegalArgumentException - if any of the arguments are null
    • Method Detail

      • setRequestControls

        public void setRequestControls​(javax.naming.ldap.Control[] requestControls)
                                throws javax.naming.NamingException
        Specified by:
        setRequestControls in interface javax.naming.ldap.LdapContext
        Overrides:
        setRequestControls in class DelegatingLdapContext
        Throws:
        javax.naming.NamingException
        See Also:
        LdapContext.setRequestControls(Control[])