Package com.netscape.jndi.ldap
Class LdapContextImpl
java.lang.Object
com.netscape.jndi.ldap.LdapContextImpl
- All Implemented Interfaces:
Context,DirContext,EventContext,EventDirContext,LdapContext
Implementation for the DirContext. The context also supports controls
through the implementation of LdapContext interface and events through
the implementaion of EventDirContext.
Semantically, the LdapContextImpl corresponds to a directory entry.
Thus a context is associated with a DN (m_ctxDN). Multiple contexts share
the same LDAPConnection which is wrapped into a LdapService object
(m_ldapSvc). Each context also maintains a set of environment properties
(m_ctxEnv). A context environment is shared among mutiple contexts using a
variation of copy-on-write algorithm (see common.ShareableEnv class).
Each context also maintains a set of LDAPSearchConstraints, as search
constrainsts like e.g. server controls, or max number of returned search
search results, are context specific. The LdapService reads the
LDAPSearchConstraints from a context that makes a service request.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected StringDN associated with this context The default value is the root DSE ("")protected ContextEnvContext environment settingprotected LdapServiceLdap Connection/Serviceprotected LDAPSearchConstraintsLdap Connection Search ConstraintsFields 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_PREFIXESFields inherited from interface javax.naming.directory.DirContext
ADD_ATTRIBUTE, REMOVE_ATTRIBUTE, REPLACE_ATTRIBUTEFields inherited from interface javax.naming.event.EventContext
OBJECT_SCOPE, ONELEVEL_SCOPE, SUBTREE_SCOPEFields inherited from interface javax.naming.ldap.LdapContext
CONTROL_FACTORIES -
Constructor Summary
ConstructorsConstructorDescriptionLdapContextImpl(String ctxDN, LdapContextImpl cloneCtx) Copy ConstructorLdapContextImpl(Hashtable<Object, Object> env) Constructor -
Method Summary
Modifier and TypeMethodDescriptionvoidaddNamingListener(String target, int scope, NamingListener l) Naming Event methods javax.naming.event.EventDirContext interface)voidaddNamingListener(String target, String filterExpr, Object[] filterArgs, SearchControls ctls, NamingListener l) voidaddNamingListener(String target, String filter, SearchControls ctls, NamingListener l) voidaddNamingListener(Name target, int scope, NamingListener l) voidaddNamingListener(Name target, String filterExpr, Object[] filterArgs, SearchControls ctls, NamingListener l) voidaddNamingListener(Name target, String filter, SearchControls ctls, NamingListener l) addToEnvironment(String propName, Object propValue) voidNaming Bind/Rename operations (javax.naming.Context, javax.naming.DirContext interface)voidbind(String name, Object obj, Attributes attrs) voidvoidbind(Name name, Object obj, Attributes attrs) (package private) StringcheckLdapUrlAsName(String name) Check if LdapURL is passed as the name paremetr to a method If that's the case, craete environment for the ldap urlvoidclose()Disconnect the Ldap Connection if close is requested LDAP operations can not be performed any more ones the context is closedcomposeName(String name, String prefix) Name operations (javax.naming.Context interface)composeName(Name name, Name prefix) createSubcontext(String name) Ldap entry operations (javax.naming.DirContext interface)createSubcontext(String name, Attributes attrs) createSubcontext(Name name) createSubcontext(Name name, Attributes attrs) voiddestroySubcontext(String name) voiddestroySubcontext(Name name) LdapContext methods (javax.naming.ldap.LdapContext interface)protected voidfinalize()Close the context when finalizedgetAttributes(String name) Attribute Operations (javax.naming.DirContext interface)getAttributes(String name, String[] attrIds) getAttributes(Name name) getAttributes(Name name, String[] attrIds) Control[](package private) StringgetDN()Return DN for this context(package private) ContextEnvgetEnv()Return reference to the context environmentEnvironment operatins (javax.naming.Context interface)getNameParser(String name) getNameParser(Name name) Control[]Control[]Schema Operations (javax.naming.DirContext interface)getSchemaClassDefinition(Name name) (package private) LDAPSearchConstraintsReturn LdapJdk search constraints for this contextList Operations (javax.naming.Context interface)listBindings(String name) listBindings(Name name) Lookup Operations (javax.naming.Context interface)lookupLink(String name) lookupLink(Name name) voidmodifyAttributes(String name, int mod_op, Attributes attrs) voidmodifyAttributes(String name, ModificationItem[] mods) voidmodifyAttributes(Name name, int mod_op, Attributes attrs) voidmodifyAttributes(Name name, ModificationItem[] mods) newInstance(Control[] reqCtls) voidvoidrebind(String name, Object obj, Attributes attrs) voidvoidrebind(Name name, Object obj, Attributes attrs) voidremoveFromEnvironment(String propName) voidvoidvoidsearch(String name, String filterExpr, Object[] filterArgs, SearchControls cons) search(String name, String filter, SearchControls cons) Search operations (javax.naming.DirContext interface)search(String name, Attributes matchingAttributes) search(String name, Attributes matchingAttributes, String[] attributesToReturn) search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) search(Name name, String filter, SearchControls cons) search(Name name, Attributes attrs) search(Name name, Attributes matchingAttributes, String[] attributesToReturn) voidsetRequestControls(Control[] reqCtls) booleantoString()Conver object to Stringvoidvoid
-
Field Details
-
m_ctxEnv
Context environment setting -
m_ctxDN
DN associated with this context The default value is the root DSE ("") -
m_ldapSvc
Ldap Connection/Service -
m_searchCons
Ldap Connection Search Constraints
-
-
Constructor Details
-
LdapContextImpl
Constructor- Throws:
NamingException
-
LdapContextImpl
Copy Constructor- Throws:
NamingException
-
-
Method Details
-
finalize
protected void finalize()Close the context when finalized -
close
Disconnect the Ldap Connection if close is requested LDAP operations can not be performed any more ones the context is closed- Specified by:
closein interfaceContext- Throws:
NamingException
-
getSearchConstraints
Return LdapJdk search constraints for this context- Throws:
NamingException
-
getDN
Return DN for this context- Throws:
NamingException
-
getEnv
ContextEnv getEnv()Return reference to the context environment -
toString
Conver object to String -
checkLdapUrlAsName
Check if LdapURL is passed as the name paremetr to a method If that's the case, craete environment for the ldap url- Throws:
NamingException
-
getEnvironment
Environment operatins (javax.naming.Context interface)- Specified by:
getEnvironmentin interfaceContext- Throws:
NamingException
-
addToEnvironment
- Specified by:
addToEnvironmentin interfaceContext- Throws:
NamingException
-
removeFromEnvironment
- Specified by:
removeFromEnvironmentin interfaceContext- Throws:
NamingException
-
composeName
Name operations (javax.naming.Context interface)- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
composeName
- Specified by:
composeNamein interfaceContext- Throws:
NamingException
-
getNameInNamespace
- Specified by:
getNameInNamespacein interfaceContext- Throws:
NamingException
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
getNameParser
- Specified by:
getNameParserin interfaceContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, String filter, SearchControls cons) throws NamingException Search operations (javax.naming.DirContext interface)- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException - Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes) throws NamingException - Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(String name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException - Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(Name name, String filter, SearchControls cons) throws NamingException - Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons) throws NamingException - Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
- Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
search
public NamingEnumeration<SearchResult> search(Name name, Attributes matchingAttributes, String[] attributesToReturn) throws NamingException - Specified by:
searchin interfaceDirContext- Throws:
NamingException
-
getAttributes
Attribute Operations (javax.naming.DirContext interface)- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
getAttributes
- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
getAttributes
- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
getAttributes
- Specified by:
getAttributesin interfaceDirContext- Throws:
NamingException
-
modifyAttributes
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
modifyAttributes
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
modifyAttributes
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
modifyAttributes
- Specified by:
modifyAttributesin interfaceDirContext- Throws:
NamingException
-
createSubcontext
Ldap entry operations (javax.naming.DirContext interface)- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
- Specified by:
createSubcontextin interfaceContext- Throws:
NamingException
-
createSubcontext
- Specified by:
createSubcontextin interfaceDirContext- Throws:
NamingException
-
createSubcontext
- Specified by:
createSubcontextin interfaceDirContext- Throws:
NamingException
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
destroySubcontext
- Specified by:
destroySubcontextin interfaceContext- Throws:
NamingException
-
bind
Naming Bind/Rename operations (javax.naming.Context, javax.naming.DirContext interface)- Specified by:
bindin interfaceContext- Throws:
NamingException
-
bind
- Specified by:
bindin interfaceContext- Throws:
NamingException
-
bind
- Specified by:
bindin interfaceDirContext- Throws:
NamingException
-
bind
- Specified by:
bindin interfaceDirContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceDirContext- Throws:
NamingException
-
rebind
- Specified by:
rebindin interfaceDirContext- Throws:
NamingException
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
rename
- Specified by:
renamein interfaceContext- Throws:
NamingException
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-
unbind
- Specified by:
unbindin interfaceContext- Throws:
NamingException
-
list
List Operations (javax.naming.Context interface)- Specified by:
listin interfaceContext- Throws:
NamingException
-
list
- Specified by:
listin interfaceContext- Throws:
NamingException
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
listBindings
- Specified by:
listBindingsin interfaceContext- Throws:
NamingException
-
lookup
Lookup Operations (javax.naming.Context interface)- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
lookup
- Specified by:
lookupin interfaceContext- Throws:
NamingException
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
lookupLink
- Specified by:
lookupLinkin interfaceContext- Throws:
NamingException
-
getSchema
Schema Operations (javax.naming.DirContext interface)- Specified by:
getSchemain interfaceDirContext- Throws:
NamingException
-
getSchema
- Specified by:
getSchemain interfaceDirContext- Throws:
NamingException
-
getSchemaClassDefinition
- Specified by:
getSchemaClassDefinitionin interfaceDirContext- Throws:
NamingException
-
getSchemaClassDefinition
- Specified by:
getSchemaClassDefinitionin interfaceDirContext- Throws:
NamingException
-
addNamingListener
Naming Event methods javax.naming.event.EventDirContext interface)- Specified by:
addNamingListenerin interfaceEventContext- Throws:
NamingException
-
addNamingListener
- Specified by:
addNamingListenerin interfaceEventContext- Throws:
NamingException
-
addNamingListener
public void addNamingListener(String target, String filter, SearchControls ctls, NamingListener l) throws NamingException - Specified by:
addNamingListenerin interfaceEventDirContext- Throws:
NamingException
-
addNamingListener
public void addNamingListener(Name target, String filter, SearchControls ctls, NamingListener l) throws NamingException - Specified by:
addNamingListenerin interfaceEventDirContext- Throws:
NamingException
-
addNamingListener
public void addNamingListener(String target, String filterExpr, Object[] filterArgs, SearchControls ctls, NamingListener l) throws NamingException - Specified by:
addNamingListenerin interfaceEventDirContext- Throws:
NamingException
-
addNamingListener
public void addNamingListener(Name target, String filterExpr, Object[] filterArgs, SearchControls ctls, NamingListener l) throws NamingException - Specified by:
addNamingListenerin interfaceEventDirContext- Throws:
NamingException
-
removeNamingListener
- Specified by:
removeNamingListenerin interfaceEventContext- Throws:
NamingException
-
targetMustExist
public boolean targetMustExist()- Specified by:
targetMustExistin interfaceEventContext
-
extendedOperation
LdapContext methods (javax.naming.ldap.LdapContext interface)- Specified by:
extendedOperationin interfaceLdapContext- Throws:
NamingException
-
getRequestControls
- Specified by:
getRequestControlsin interfaceLdapContext- Throws:
NamingException
-
setRequestControls
- Specified by:
setRequestControlsin interfaceLdapContext- Throws:
NamingException
-
getResponseControls
- Specified by:
getResponseControlsin interfaceLdapContext- Throws:
NamingException
-
newInstance
- Specified by:
newInstancein interfaceLdapContext- Throws:
NamingException
-
reconnect
- Specified by:
reconnectin interfaceLdapContext- Throws:
NamingException
-
getConnectControls
- Specified by:
getConnectControlsin interfaceLdapContext
-