Package org.springframework.ldap.pool2
Class DelegatingLdapContext
java.lang.Object
org.springframework.ldap.pool2.DelegatingContext
org.springframework.ldap.pool2.DelegatingDirContext
org.springframework.ldap.pool2.DelegatingLdapContext
- All Implemented Interfaces:
Context
,DirContext
,LdapContext
,DirContextProxy
- Direct Known Subclasses:
MutableDelegatingLdapContext
Used by
PooledContextSource
to wrap a LdapContext
, delegating most
methods to the underlying context. This class extends DelegatingDirContext
which handles returning the context to the pool on a call to close()
- Since:
- 2.0
-
Field Summary
Fields inherited from interface javax.naming.Context
APPLET, AUTHORITATIVE, BATCHSIZE, DNS_URL, INITIAL_CONTEXT_FACTORY, LANGUAGE, OBJECT_FACTORIES, PROVIDER_URL, REFERRAL, SECURITY_AUTHENTICATION, SECURITY_CREDENTIALS, SECURITY_PRINCIPAL, SECURITY_PROTOCOL, STATE_FACTORIES, URL_PKG_PREFIXES
Fields inherited from interface javax.naming.directory.DirContext
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
Fields inherited from interface javax.naming.ldap.LdapContext
CONTROL_FACTORIES
-
Constructor Summary
ConstructorDescriptionDelegatingLdapContext
(org.apache.commons.pool2.KeyedObjectPool<Object, Object> keyedObjectPool, LdapContext delegateLdapContext, DirContextType dirContextType) Create a new delegating ldap context for the specified pool, context and context type. -
Method Summary
Modifier and TypeMethodDescriptionprotected void
void
close()
boolean
extendedOperation
(ExtendedRequest request) Control[]
Recursivley inspect delegates until a non-delegating ldap context is found.Control[]
Control[]
int
hashCode()
newInstance
(Control[] requestControls) void
void
setRequestControls
(Control[] requestControls) toString()
Methods inherited from class org.springframework.ldap.pool2.DelegatingDirContext
bind, bind, createSubcontext, createSubcontext, getAttributes, getAttributes, getAttributes, getAttributes, getDelegateContext, getInnermostDelegateDirContext, getSchema, getSchema, getSchemaClassDefinition, getSchemaClassDefinition, getTargetContext, modifyAttributes, modifyAttributes, modifyAttributes, modifyAttributes, rebind, rebind, search, search, search, search, search, search, search, search
Methods inherited from class org.springframework.ldap.pool2.DelegatingContext
addToEnvironment, bind, bind, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getInnermostDelegateContext, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbind
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.naming.Context
addToEnvironment, bind, bind, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getEnvironment, getNameInNamespace, getNameParser, getNameParser, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbind
Methods inherited from interface javax.naming.directory.DirContext
bind, bind, createSubcontext, createSubcontext, getAttributes, getAttributes, getAttributes, getAttributes, getSchema, getSchema, getSchemaClassDefinition, getSchemaClassDefinition, modifyAttributes, modifyAttributes, modifyAttributes, modifyAttributes, rebind, rebind, search, search, search, search, search, search, search, search
-
Constructor Details
-
DelegatingLdapContext
public DelegatingLdapContext(org.apache.commons.pool2.KeyedObjectPool<Object, Object> keyedObjectPool, LdapContext delegateLdapContext, DirContextType dirContextType) Create a new 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:
IllegalArgumentException
- if any of the arguments are null
-
-
Method Details
-
getDelegateLdapContext
- Returns:
- The direct delegate for this ldap context proxy
-
getDelegateDirContext
- Overrides:
getDelegateDirContext
in classDelegatingDirContext
- Returns:
- The direct delegate for this dir context proxy
-
getInnermostDelegateLdapContext
Recursivley inspect delegates until a non-delegating ldap context is found.- Returns:
- The innermost (real) DirContext that is being delegated to.
-
assertOpen
- Overrides:
assertOpen
in classDelegatingDirContext
- Throws:
NamingException
- If the delegate is null,DelegatingContext.close()
has been called.
-
equals
- Overrides:
equals
in classDelegatingDirContext
- See Also:
-
hashCode
public int hashCode()- Overrides:
hashCode
in classDelegatingDirContext
- See Also:
-
toString
- Overrides:
toString
in classDelegatingDirContext
- See Also:
-
extendedOperation
- Specified by:
extendedOperation
in interfaceLdapContext
- Throws:
NamingException
- See Also:
-
getConnectControls
- Specified by:
getConnectControls
in interfaceLdapContext
- Throws:
NamingException
- See Also:
-
getRequestControls
- Specified by:
getRequestControls
in interfaceLdapContext
- Throws:
NamingException
- See Also:
-
getResponseControls
- Specified by:
getResponseControls
in interfaceLdapContext
- Throws:
NamingException
- See Also:
-
newInstance
- Specified by:
newInstance
in interfaceLdapContext
- Throws:
NamingException
- See Also:
-
reconnect
- Specified by:
reconnect
in interfaceLdapContext
- Throws:
NamingException
- See Also:
-
setRequestControls
- Specified by:
setRequestControls
in interfaceLdapContext
- Throws:
NamingException
- See Also:
-
close
- Specified by:
close
in interfaceContext
- Overrides:
close
in classDelegatingDirContext
- Throws:
NamingException
- See Also:
-