public class DelegatingLdapContext extends DelegatingDirContext implements LdapContext
PoolingContextSource 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()CONTROL_FACTORIESADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTEAPPLET, 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| Constructor and Description |
|---|
DelegatingLdapContext(org.apache.commons.pool.KeyedObjectPool keyedObjectPool,
LdapContext delegateLdapContext,
DirContextType dirContextType)
Create a new delegating ldap context for the specified pool, context and context type.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
assertOpen() |
void |
close() |
boolean |
equals(Object obj) |
ExtendedResponse |
extendedOperation(ExtendedRequest request) |
Control[] |
getConnectControls() |
DirContext |
getDelegateDirContext() |
LdapContext |
getDelegateLdapContext() |
LdapContext |
getInnermostDelegateLdapContext()
Recursivley inspect delegates until a non-delegating ldap context is found.
|
Control[] |
getRequestControls() |
Control[] |
getResponseControls() |
int |
hashCode() |
LdapContext |
newInstance(Control[] requestControls) |
void |
reconnect(Control[] connCtls) |
void |
setRequestControls(Control[] requestControls) |
String |
toString() |
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, searchaddToEnvironment, 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, unbindclone, finalize, getClass, notify, notifyAll, wait, wait, waitbind, bind, createSubcontext, createSubcontext, getAttributes, getAttributes, getAttributes, getAttributes, getSchema, getSchema, getSchemaClassDefinition, getSchemaClassDefinition, modifyAttributes, modifyAttributes, modifyAttributes, modifyAttributes, rebind, rebind, search, search, search, search, search, search, search, searchaddToEnvironment, 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, unbindpublic DelegatingLdapContext(org.apache.commons.pool.KeyedObjectPool keyedObjectPool,
LdapContext delegateLdapContext,
DirContextType dirContextType)
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.IllegalArgumentException - if any of the arguments are nullpublic LdapContext getDelegateLdapContext()
public DirContext getDelegateDirContext()
getDelegateDirContext in class DelegatingDirContextpublic LdapContext getInnermostDelegateLdapContext()
protected void assertOpen()
throws NamingException
assertOpen in class DelegatingDirContextNamingException - If the delegate is null, DelegatingContext.close() has been called.public boolean equals(Object obj)
equals in class DelegatingDirContextObject.equals(java.lang.Object)public int hashCode()
hashCode in class DelegatingDirContextObject.hashCode()public String toString()
toString in class DelegatingDirContextObject.toString()public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException
extendedOperation in interface LdapContextNamingExceptionLdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest)public Control[] getConnectControls() throws NamingException
getConnectControls in interface LdapContextNamingExceptionLdapContext.getConnectControls()public Control[] getRequestControls() throws NamingException
getRequestControls in interface LdapContextNamingExceptionLdapContext.getRequestControls()public Control[] getResponseControls() throws NamingException
getResponseControls in interface LdapContextNamingExceptionLdapContext.getResponseControls()public LdapContext newInstance(Control[] requestControls) throws NamingException
newInstance in interface LdapContextNamingExceptionLdapContext.newInstance(javax.naming.ldap.Control[])public void reconnect(Control[] connCtls) throws NamingException
reconnect in interface LdapContextNamingExceptionLdapContext.reconnect(javax.naming.ldap.Control[])public void setRequestControls(Control[] requestControls) throws NamingException
setRequestControls in interface LdapContextNamingExceptionLdapContext.setRequestControls(javax.naming.ldap.Control[])public void close()
throws NamingException
close in interface Contextclose in class DelegatingDirContextNamingExceptionDelegatingDirContext.close()