public class DelegatingLdapContext extends DelegatingDirContext implements LdapContext
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()
CONTROL_FACTORIES
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTE
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
Constructor and Description |
---|
DelegatingLdapContext(KeyedObjectPool<Object,Object> 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, search
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
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
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
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
public DelegatingLdapContext(KeyedObjectPool<Object,Object> 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 DelegatingDirContext
public LdapContext getInnermostDelegateLdapContext()
protected void assertOpen() throws NamingException
assertOpen
in class DelegatingDirContext
NamingException
- If the delegate is null, DelegatingContext.close()
has been called.public boolean equals(Object obj)
equals
in class DelegatingDirContext
Object.equals(Object)
public int hashCode()
hashCode
in class DelegatingDirContext
Object.hashCode()
public String toString()
toString
in class DelegatingDirContext
Object.toString()
public ExtendedResponse extendedOperation(ExtendedRequest request) throws NamingException
extendedOperation
in interface LdapContext
NamingException
LdapContext.extendedOperation(ExtendedRequest)
public Control[] getConnectControls() throws NamingException
getConnectControls
in interface LdapContext
NamingException
LdapContext.getConnectControls()
public Control[] getRequestControls() throws NamingException
getRequestControls
in interface LdapContext
NamingException
LdapContext.getRequestControls()
public Control[] getResponseControls() throws NamingException
getResponseControls
in interface LdapContext
NamingException
LdapContext.getResponseControls()
public LdapContext newInstance(Control[] requestControls) throws NamingException
newInstance
in interface LdapContext
NamingException
LdapContext.newInstance(Control[])
public void reconnect(Control[] connCtls) throws NamingException
reconnect
in interface LdapContext
NamingException
LdapContext.reconnect(Control[])
public void setRequestControls(Control[] requestControls) throws NamingException
setRequestControls
in interface LdapContext
NamingException
LdapContext.setRequestControls(Control[])
public void close() throws NamingException
close
in interface Context
close
in class DelegatingDirContext
NamingException
DelegatingDirContext.close()