javax.naming.ldap
Class InitialLdapContext

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.naming.InitialContext sample code for javax.naming.InitialContext definition code for javax.naming.InitialContext 
      extended by javax.naming.directory.InitialDirContext sample code for javax.naming.directory.InitialDirContext definition code for javax.naming.directory.InitialDirContext 
          extended by javax.naming.ldap.InitialLdapContext
All Implemented Interfaces:
Context sample code for javax.naming.Context definition code for javax.naming.Context , DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext , LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext

public class InitialLdapContext
extends InitialDirContext sample code for javax.naming.directory.InitialDirContext definition code for javax.naming.directory.InitialDirContext
implements LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext

This class is the starting context for performing LDAPv3-style extended operations and controls.

See javax.naming.InitialContext and javax.naming.InitialDirContext for details on synchronization, and the policy for how an initial context is created.

Request Controls

When you create an initial context (InitialLdapContext), you can specify a list of request controls. These controls will be used as the request controls for any implicit LDAP "bind" operation performed by the context or contexts derived from the context. These are called connection request controls. Use getConnectControls() to get a context's connection request controls.

The request controls supplied to the initial context constructor are not used as the context request controls for subsequent context operations such as searches and lookups. Context request controls are set and updated by using setRequestControls().

As shown, there can be two different sets of request controls associated with a context: connection request controls and context request controls. This is required for those applications needing to send critical controls that might not be applicable to both the context operation and any implicit LDAP "bind" operation. A typical user program would do the following:

 InitialLdapContext lctx = new InitialLdapContext(env, critConnCtls);
 lctx.setRequestControls(critModCtls);
 lctx.modifyAttributes(name, mods);
 Controls[] respCtls =  lctx.getResponseControls();
It specifies first the critical controls for creating the initial context (critConnCtls), and then sets the context's request controls (critModCtls) for the context operation. If for some reason lctx needs to reconnect to the server, it will use critConnCtls. See the LdapContext interface for more discussion about request controls.

Service provider implementors should read the "Service Provider" section in the LdapContext class description for implementation details.

Since:
1.3
See Also:
LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext , InitialContext sample code for javax.naming.InitialContext definition code for javax.naming.InitialContext , InitialDirContext sample code for javax.naming.directory.InitialDirContext definition code for javax.naming.directory.InitialDirContext , NamingManager.setInitialContextFactoryBuilder(javax.naming.spi.InitialContextFactoryBuilder) sample code for javax.naming.spi.NamingManager.setInitialContextFactoryBuilder(javax.naming.spi.InitialContextFactoryBuilder) definition code for javax.naming.spi.NamingManager.setInitialContextFactoryBuilder(javax.naming.spi.InitialContextFactoryBuilder)

Field Summary
 
Fields inherited from class javax.naming.InitialContext sample code for javax.naming.InitialContext definition code for javax.naming.InitialContext
defaultInitCtx sample code for javax.naming.InitialContext.defaultInitCtx definition code for javax.naming.InitialContext.defaultInitCtx , gotDefault sample code for javax.naming.InitialContext.gotDefault definition code for javax.naming.InitialContext.gotDefault , myProps sample code for javax.naming.InitialContext.myProps definition code for javax.naming.InitialContext.myProps
 
Fields inherited from interface javax.naming.ldap.LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
CONTROL_FACTORIES sample code for javax.naming.ldap.LdapContext.CONTROL_FACTORIES definition code for javax.naming.ldap.LdapContext.CONTROL_FACTORIES
 
Fields inherited from interface javax.naming.directory.DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext
ADD_ATTRIBUTE sample code for javax.naming.directory.DirContext.ADD_ATTRIBUTE definition code for javax.naming.directory.DirContext.ADD_ATTRIBUTE , REMOVE_ATTRIBUTE sample code for javax.naming.directory.DirContext.REMOVE_ATTRIBUTE definition code for javax.naming.directory.DirContext.REMOVE_ATTRIBUTE , REPLACE_ATTRIBUTE sample code for javax.naming.directory.DirContext.REPLACE_ATTRIBUTE definition code for javax.naming.directory.DirContext.REPLACE_ATTRIBUTE
 
Fields inherited from interface javax.naming.Context sample code for javax.naming.Context definition code for javax.naming.Context
APPLET sample code for javax.naming.Context.APPLET definition code for javax.naming.Context.APPLET , AUTHORITATIVE sample code for javax.naming.Context.AUTHORITATIVE definition code for javax.naming.Context.AUTHORITATIVE , BATCHSIZE sample code for javax.naming.Context.BATCHSIZE definition code for javax.naming.Context.BATCHSIZE , DNS_URL sample code for javax.naming.Context.DNS_URL definition code for javax.naming.Context.DNS_URL , INITIAL_CONTEXT_FACTORY sample code for javax.naming.Context.INITIAL_CONTEXT_FACTORY definition code for javax.naming.Context.INITIAL_CONTEXT_FACTORY , LANGUAGE sample code for javax.naming.Context.LANGUAGE definition code for javax.naming.Context.LANGUAGE , OBJECT_FACTORIES sample code for javax.naming.Context.OBJECT_FACTORIES definition code for javax.naming.Context.OBJECT_FACTORIES , PROVIDER_URL sample code for javax.naming.Context.PROVIDER_URL definition code for javax.naming.Context.PROVIDER_URL , REFERRAL sample code for javax.naming.Context.REFERRAL definition code for javax.naming.Context.REFERRAL , SECURITY_AUTHENTICATION sample code for javax.naming.Context.SECURITY_AUTHENTICATION definition code for javax.naming.Context.SECURITY_AUTHENTICATION , SECURITY_CREDENTIALS sample code for javax.naming.Context.SECURITY_CREDENTIALS definition code for javax.naming.Context.SECURITY_CREDENTIALS , SECURITY_PRINCIPAL sample code for javax.naming.Context.SECURITY_PRINCIPAL definition code for javax.naming.Context.SECURITY_PRINCIPAL , SECURITY_PROTOCOL sample code for javax.naming.Context.SECURITY_PROTOCOL definition code for javax.naming.Context.SECURITY_PROTOCOL , STATE_FACTORIES sample code for javax.naming.Context.STATE_FACTORIES definition code for javax.naming.Context.STATE_FACTORIES , URL_PKG_PREFIXES sample code for javax.naming.Context.URL_PKG_PREFIXES definition code for javax.naming.Context.URL_PKG_PREFIXES
 
Constructor Summary
InitialLdapContext sample code for javax.naming.ldap.InitialLdapContext.InitialLdapContext() definition code for javax.naming.ldap.InitialLdapContext.InitialLdapContext() ()
          Constructs an initial context using no environment properties or connection request controls.
InitialLdapContext sample code for javax.naming.ldap.InitialLdapContext.InitialLdapContext(java.util.Hashtable, javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.InitialLdapContext(java.util.Hashtable, javax.naming.ldap.Control[]) (Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment, Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] connCtls)
          Constructs an initial context using environment properties and connection request controls.
 
Method Summary
 ExtendedResponse sample code for javax.naming.ldap.ExtendedResponse definition code for javax.naming.ldap.ExtendedResponse extendedOperation sample code for javax.naming.ldap.InitialLdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest) definition code for javax.naming.ldap.InitialLdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest) (ExtendedRequest sample code for javax.naming.ldap.ExtendedRequest definition code for javax.naming.ldap.ExtendedRequest  request)
          Performs an extended operation.
 Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] getConnectControls sample code for javax.naming.ldap.InitialLdapContext.getConnectControls() definition code for javax.naming.ldap.InitialLdapContext.getConnectControls() ()
          Retrieves the connection request controls in effect for this context.
 Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] getRequestControls sample code for javax.naming.ldap.InitialLdapContext.getRequestControls() definition code for javax.naming.ldap.InitialLdapContext.getRequestControls() ()
          Retrieves the request controls in effect for this context.
 Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] getResponseControls sample code for javax.naming.ldap.InitialLdapContext.getResponseControls() definition code for javax.naming.ldap.InitialLdapContext.getResponseControls() ()
          Retrieves the response controls produced as a result of the last method invoked on this context.
 LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext newInstance sample code for javax.naming.ldap.InitialLdapContext.newInstance(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.newInstance(javax.naming.ldap.Control[]) (Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] reqCtls)
          Creates a new instance of this context initialized using request controls.
 void reconnect sample code for javax.naming.ldap.InitialLdapContext.reconnect(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.reconnect(javax.naming.ldap.Control[]) (Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] connCtls)
          Reconnects to the LDAP server using the supplied controls and this context's environment.
 void setRequestControls sample code for javax.naming.ldap.InitialLdapContext.setRequestControls(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.setRequestControls(javax.naming.ldap.Control[]) (Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] requestControls)
          Sets the request controls for methods subsequently invoked on this context.
 
Methods inherited from class javax.naming.directory.InitialDirContext sample code for javax.naming.directory.InitialDirContext definition code for javax.naming.directory.InitialDirContext
bind sample code for javax.naming.directory.InitialDirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) , bind sample code for javax.naming.directory.InitialDirContext.bind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.bind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) , createSubcontext sample code for javax.naming.directory.InitialDirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes) , createSubcontext sample code for javax.naming.directory.InitialDirContext.createSubcontext(java.lang.String, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.createSubcontext(java.lang.String, javax.naming.directory.Attributes) , getAttributes sample code for javax.naming.directory.InitialDirContext.getAttributes(javax.naming.Name) definition code for javax.naming.directory.InitialDirContext.getAttributes(javax.naming.Name) , getAttributes sample code for javax.naming.directory.InitialDirContext.getAttributes(javax.naming.Name, java.lang.String[]) definition code for javax.naming.directory.InitialDirContext.getAttributes(javax.naming.Name, java.lang.String[]) , getAttributes sample code for javax.naming.directory.InitialDirContext.getAttributes(java.lang.String) definition code for javax.naming.directory.InitialDirContext.getAttributes(java.lang.String) , getAttributes sample code for javax.naming.directory.InitialDirContext.getAttributes(java.lang.String, java.lang.String[]) definition code for javax.naming.directory.InitialDirContext.getAttributes(java.lang.String, java.lang.String[]) , getSchema sample code for javax.naming.directory.InitialDirContext.getSchema(javax.naming.Name) definition code for javax.naming.directory.InitialDirContext.getSchema(javax.naming.Name) , getSchema sample code for javax.naming.directory.InitialDirContext.getSchema(java.lang.String) definition code for javax.naming.directory.InitialDirContext.getSchema(java.lang.String) , getSchemaClassDefinition sample code for javax.naming.directory.InitialDirContext.getSchemaClassDefinition(javax.naming.Name) definition code for javax.naming.directory.InitialDirContext.getSchemaClassDefinition(javax.naming.Name) , getSchemaClassDefinition sample code for javax.naming.directory.InitialDirContext.getSchemaClassDefinition(java.lang.String) definition code for javax.naming.directory.InitialDirContext.getSchemaClassDefinition(java.lang.String) , modifyAttributes sample code for javax.naming.directory.InitialDirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes) , modifyAttributes sample code for javax.naming.directory.InitialDirContext.modifyAttributes(javax.naming.Name, javax.naming.directory.ModificationItem[]) definition code for javax.naming.directory.InitialDirContext.modifyAttributes(javax.naming.Name, javax.naming.directory.ModificationItem[]) , modifyAttributes sample code for javax.naming.directory.InitialDirContext.modifyAttributes(java.lang.String, int, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.modifyAttributes(java.lang.String, int, javax.naming.directory.Attributes) , modifyAttributes sample code for javax.naming.directory.InitialDirContext.modifyAttributes(java.lang.String, javax.naming.directory.ModificationItem[]) definition code for javax.naming.directory.InitialDirContext.modifyAttributes(java.lang.String, javax.naming.directory.ModificationItem[]) , rebind sample code for javax.naming.directory.InitialDirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) , rebind sample code for javax.naming.directory.InitialDirContext.rebind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.rebind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) , search sample code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, javax.naming.directory.Attributes) , search sample code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]) definition code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]) , search sample code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) definition code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) , search sample code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, java.lang.String, javax.naming.directory.SearchControls) definition code for javax.naming.directory.InitialDirContext.search(javax.naming.Name, java.lang.String, javax.naming.directory.SearchControls) , search sample code for javax.naming.directory.InitialDirContext.search(java.lang.String, javax.naming.directory.Attributes) definition code for javax.naming.directory.InitialDirContext.search(java.lang.String, javax.naming.directory.Attributes) , search sample code for javax.naming.directory.InitialDirContext.search(java.lang.String, javax.naming.directory.Attributes, java.lang.String[]) definition code for javax.naming.directory.InitialDirContext.search(java.lang.String, javax.naming.directory.Attributes, java.lang.String[]) , search sample code for javax.naming.directory.InitialDirContext.search(java.lang.String, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) definition code for javax.naming.directory.InitialDirContext.search(java.lang.String, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) , search sample code for javax.naming.directory.InitialDirContext.search(java.lang.String, java.lang.String, javax.naming.directory.SearchControls) definition code for javax.naming.directory.InitialDirContext.search(java.lang.String, java.lang.String, javax.naming.directory.SearchControls)
 
Methods inherited from class javax.naming.InitialContext sample code for javax.naming.InitialContext definition code for javax.naming.InitialContext
addToEnvironment sample code for javax.naming.InitialContext.addToEnvironment(java.lang.String, java.lang.Object) definition code for javax.naming.InitialContext.addToEnvironment(java.lang.String, java.lang.Object) , bind sample code for javax.naming.InitialContext.bind(javax.naming.Name, java.lang.Object) definition code for javax.naming.InitialContext.bind(javax.naming.Name, java.lang.Object) , bind sample code for javax.naming.InitialContext.bind(java.lang.String, java.lang.Object) definition code for javax.naming.InitialContext.bind(java.lang.String, java.lang.Object) , close sample code for javax.naming.InitialContext.close() definition code for javax.naming.InitialContext.close() , composeName sample code for javax.naming.InitialContext.composeName(javax.naming.Name, javax.naming.Name) definition code for javax.naming.InitialContext.composeName(javax.naming.Name, javax.naming.Name) , composeName sample code for javax.naming.InitialContext.composeName(java.lang.String, java.lang.String) definition code for javax.naming.InitialContext.composeName(java.lang.String, java.lang.String) , createSubcontext sample code for javax.naming.InitialContext.createSubcontext(javax.naming.Name) definition code for javax.naming.InitialContext.createSubcontext(javax.naming.Name) , createSubcontext sample code for javax.naming.InitialContext.createSubcontext(java.lang.String) definition code for javax.naming.InitialContext.createSubcontext(java.lang.String) , destroySubcontext sample code for javax.naming.InitialContext.destroySubcontext(javax.naming.Name) definition code for javax.naming.InitialContext.destroySubcontext(javax.naming.Name) , destroySubcontext sample code for javax.naming.InitialContext.destroySubcontext(java.lang.String) definition code for javax.naming.InitialContext.destroySubcontext(java.lang.String) , getDefaultInitCtx sample code for javax.naming.InitialContext.getDefaultInitCtx() definition code for javax.naming.InitialContext.getDefaultInitCtx() , getEnvironment sample code for javax.naming.InitialContext.getEnvironment() definition code for javax.naming.InitialContext.getEnvironment() , getNameInNamespace sample code for javax.naming.InitialContext.getNameInNamespace() definition code for javax.naming.InitialContext.getNameInNamespace() , getNameParser sample code for javax.naming.InitialContext.getNameParser(javax.naming.Name) definition code for javax.naming.InitialContext.getNameParser(javax.naming.Name) , getNameParser sample code for javax.naming.InitialContext.getNameParser(java.lang.String) definition code for javax.naming.InitialContext.getNameParser(java.lang.String) , getURLOrDefaultInitCtx sample code for javax.naming.InitialContext.getURLOrDefaultInitCtx(javax.naming.Name) definition code for javax.naming.InitialContext.getURLOrDefaultInitCtx(javax.naming.Name) , getURLOrDefaultInitCtx sample code for javax.naming.InitialContext.getURLOrDefaultInitCtx(java.lang.String) definition code for javax.naming.InitialContext.getURLOrDefaultInitCtx(java.lang.String) , init sample code for javax.naming.InitialContext.init(java.util.Hashtable) definition code for javax.naming.InitialContext.init(java.util.Hashtable) , list sample code for javax.naming.InitialContext.list(javax.naming.Name) definition code for javax.naming.InitialContext.list(javax.naming.Name) , list sample code for javax.naming.InitialContext.list(java.lang.String) definition code for javax.naming.InitialContext.list(java.lang.String) , listBindings sample code for javax.naming.InitialContext.listBindings(javax.naming.Name) definition code for javax.naming.InitialContext.listBindings(javax.naming.Name) , listBindings sample code for javax.naming.InitialContext.listBindings(java.lang.String) definition code for javax.naming.InitialContext.listBindings(java.lang.String) , lookup sample code for javax.naming.InitialContext.lookup(javax.naming.Name) definition code for javax.naming.InitialContext.lookup(javax.naming.Name) , lookup sample code for javax.naming.InitialContext.lookup(java.lang.String) definition code for javax.naming.InitialContext.lookup(java.lang.String) , lookupLink sample code for javax.naming.InitialContext.lookupLink(javax.naming.Name) definition code for javax.naming.InitialContext.lookupLink(javax.naming.Name) , lookupLink sample code for javax.naming.InitialContext.lookupLink(java.lang.String) definition code for javax.naming.InitialContext.lookupLink(java.lang.String) , rebind sample code for javax.naming.InitialContext.rebind(javax.naming.Name, java.lang.Object) definition code for javax.naming.InitialContext.rebind(javax.naming.Name, java.lang.Object) , rebind sample code for javax.naming.InitialContext.rebind(java.lang.String, java.lang.Object) definition code for javax.naming.InitialContext.rebind(java.lang.String, java.lang.Object) , removeFromEnvironment sample code for javax.naming.InitialContext.removeFromEnvironment(java.lang.String) definition code for javax.naming.InitialContext.removeFromEnvironment(java.lang.String) , rename sample code for javax.naming.InitialContext.rename(javax.naming.Name, javax.naming.Name) definition code for javax.naming.InitialContext.rename(javax.naming.Name, javax.naming.Name) , rename sample code for javax.naming.InitialContext.rename(java.lang.String, java.lang.String) definition code for javax.naming.InitialContext.rename(java.lang.String, java.lang.String) , unbind sample code for javax.naming.InitialContext.unbind(javax.naming.Name) definition code for javax.naming.InitialContext.unbind(javax.naming.Name) , unbind sample code for javax.naming.InitialContext.unbind(java.lang.String) definition code for javax.naming.InitialContext.unbind(java.lang.String)
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 
Methods inherited from interface javax.naming.directory.DirContext sample code for javax.naming.directory.DirContext definition code for javax.naming.directory.DirContext
bind sample code for javax.naming.directory.DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.bind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) , bind sample code for javax.naming.directory.DirContext.bind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.bind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) , createSubcontext sample code for javax.naming.directory.DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.createSubcontext(javax.naming.Name, javax.naming.directory.Attributes) , createSubcontext sample code for javax.naming.directory.DirContext.createSubcontext(java.lang.String, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.createSubcontext(java.lang.String, javax.naming.directory.Attributes) , getAttributes sample code for javax.naming.directory.DirContext.getAttributes(javax.naming.Name) definition code for javax.naming.directory.DirContext.getAttributes(javax.naming.Name) , getAttributes sample code for javax.naming.directory.DirContext.getAttributes(javax.naming.Name, java.lang.String[]) definition code for javax.naming.directory.DirContext.getAttributes(javax.naming.Name, java.lang.String[]) , getAttributes sample code for javax.naming.directory.DirContext.getAttributes(java.lang.String) definition code for javax.naming.directory.DirContext.getAttributes(java.lang.String) , getAttributes sample code for javax.naming.directory.DirContext.getAttributes(java.lang.String, java.lang.String[]) definition code for javax.naming.directory.DirContext.getAttributes(java.lang.String, java.lang.String[]) , getSchema sample code for javax.naming.directory.DirContext.getSchema(javax.naming.Name) definition code for javax.naming.directory.DirContext.getSchema(javax.naming.Name) , getSchema sample code for javax.naming.directory.DirContext.getSchema(java.lang.String) definition code for javax.naming.directory.DirContext.getSchema(java.lang.String) , getSchemaClassDefinition sample code for javax.naming.directory.DirContext.getSchemaClassDefinition(javax.naming.Name) definition code for javax.naming.directory.DirContext.getSchemaClassDefinition(javax.naming.Name) , getSchemaClassDefinition sample code for javax.naming.directory.DirContext.getSchemaClassDefinition(java.lang.String) definition code for javax.naming.directory.DirContext.getSchemaClassDefinition(java.lang.String) , modifyAttributes sample code for javax.naming.directory.DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.modifyAttributes(javax.naming.Name, int, javax.naming.directory.Attributes) , modifyAttributes sample code for javax.naming.directory.DirContext.modifyAttributes(javax.naming.Name, javax.naming.directory.ModificationItem[]) definition code for javax.naming.directory.DirContext.modifyAttributes(javax.naming.Name, javax.naming.directory.ModificationItem[]) , modifyAttributes sample code for javax.naming.directory.DirContext.modifyAttributes(java.lang.String, int, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.modifyAttributes(java.lang.String, int, javax.naming.directory.Attributes) , modifyAttributes sample code for javax.naming.directory.DirContext.modifyAttributes(java.lang.String, javax.naming.directory.ModificationItem[]) definition code for javax.naming.directory.DirContext.modifyAttributes(java.lang.String, javax.naming.directory.ModificationItem[]) , rebind sample code for javax.naming.directory.DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.rebind(javax.naming.Name, java.lang.Object, javax.naming.directory.Attributes) , rebind sample code for javax.naming.directory.DirContext.rebind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.rebind(java.lang.String, java.lang.Object, javax.naming.directory.Attributes) , search sample code for javax.naming.directory.DirContext.search(javax.naming.Name, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.search(javax.naming.Name, javax.naming.directory.Attributes) , search sample code for javax.naming.directory.DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]) definition code for javax.naming.directory.DirContext.search(javax.naming.Name, javax.naming.directory.Attributes, java.lang.String[]) , search sample code for javax.naming.directory.DirContext.search(javax.naming.Name, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) definition code for javax.naming.directory.DirContext.search(javax.naming.Name, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) , search sample code for javax.naming.directory.DirContext.search(javax.naming.Name, java.lang.String, javax.naming.directory.SearchControls) definition code for javax.naming.directory.DirContext.search(javax.naming.Name, java.lang.String, javax.naming.directory.SearchControls) , search sample code for javax.naming.directory.DirContext.search(java.lang.String, javax.naming.directory.Attributes) definition code for javax.naming.directory.DirContext.search(java.lang.String, javax.naming.directory.Attributes) , search sample code for javax.naming.directory.DirContext.search(java.lang.String, javax.naming.directory.Attributes, java.lang.String[]) definition code for javax.naming.directory.DirContext.search(java.lang.String, javax.naming.directory.Attributes, java.lang.String[]) , search sample code for javax.naming.directory.DirContext.search(java.lang.String, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) definition code for javax.naming.directory.DirContext.search(java.lang.String, java.lang.String, java.lang.Object[], javax.naming.directory.SearchControls) , search sample code for javax.naming.directory.DirContext.search(java.lang.String, java.lang.String, javax.naming.directory.SearchControls) definition code for javax.naming.directory.DirContext.search(java.lang.String, java.lang.String, javax.naming.directory.SearchControls)
 
Methods inherited from interface javax.naming.Context sample code for javax.naming.Context definition code for javax.naming.Context
addToEnvironment sample code for javax.naming.Context.addToEnvironment(java.lang.String, java.lang.Object) definition code for javax.naming.Context.addToEnvironment(java.lang.String, java.lang.Object) , bind sample code for javax.naming.Context.bind(javax.naming.Name, java.lang.Object) definition code for javax.naming.Context.bind(javax.naming.Name, java.lang.Object) , bind sample code for javax.naming.Context.bind(java.lang.String, java.lang.Object) definition code for javax.naming.Context.bind(java.lang.String, java.lang.Object) , close sample code for javax.naming.Context.close() definition code for javax.naming.Context.close() , composeName sample code for javax.naming.Context.composeName(javax.naming.Name, javax.naming.Name) definition code for javax.naming.Context.composeName(javax.naming.Name, javax.naming.Name) , composeName sample code for javax.naming.Context.composeName(java.lang.String, java.lang.String) definition code for javax.naming.Context.composeName(java.lang.String, java.lang.String) , createSubcontext sample code for javax.naming.Context.createSubcontext(javax.naming.Name) definition code for javax.naming.Context.createSubcontext(javax.naming.Name) , createSubcontext sample code for javax.naming.Context.createSubcontext(java.lang.String) definition code for javax.naming.Context.createSubcontext(java.lang.String) , destroySubcontext sample code for javax.naming.Context.destroySubcontext(javax.naming.Name) definition code for javax.naming.Context.destroySubcontext(javax.naming.Name) , destroySubcontext sample code for javax.naming.Context.destroySubcontext(java.lang.String) definition code for javax.naming.Context.destroySubcontext(java.lang.String) , getEnvironment sample code for javax.naming.Context.getEnvironment() definition code for javax.naming.Context.getEnvironment() , getNameInNamespace sample code for javax.naming.Context.getNameInNamespace() definition code for javax.naming.Context.getNameInNamespace() , getNameParser sample code for javax.naming.Context.getNameParser(javax.naming.Name) definition code for javax.naming.Context.getNameParser(javax.naming.Name) , getNameParser sample code for javax.naming.Context.getNameParser(java.lang.String) definition code for javax.naming.Context.getNameParser(java.lang.String) , list sample code for javax.naming.Context.list(javax.naming.Name) definition code for javax.naming.Context.list(javax.naming.Name) , list sample code for javax.naming.Context.list(java.lang.String) definition code for javax.naming.Context.list(java.lang.String) , listBindings sample code for javax.naming.Context.listBindings(javax.naming.Name) definition code for javax.naming.Context.listBindings(javax.naming.Name) , listBindings sample code for javax.naming.Context.listBindings(java.lang.String) definition code for javax.naming.Context.listBindings(java.lang.String) , lookup sample code for javax.naming.Context.lookup(javax.naming.Name) definition code for javax.naming.Context.lookup(javax.naming.Name) , lookup sample code for javax.naming.Context.lookup(java.lang.String) definition code for javax.naming.Context.lookup(java.lang.String) , lookupLink sample code for javax.naming.Context.lookupLink(javax.naming.Name) definition code for javax.naming.Context.lookupLink(javax.naming.Name) , lookupLink sample code for javax.naming.Context.lookupLink(java.lang.String) definition code for javax.naming.Context.lookupLink(java.lang.String) , rebind sample code for javax.naming.Context.rebind(javax.naming.Name, java.lang.Object) definition code for javax.naming.Context.rebind(javax.naming.Name, java.lang.Object) , rebind sample code for javax.naming.Context.rebind(java.lang.String, java.lang.Object) definition code for javax.naming.Context.rebind(java.lang.String, java.lang.Object) , removeFromEnvironment sample code for javax.naming.Context.removeFromEnvironment(java.lang.String) definition code for javax.naming.Context.removeFromEnvironment(java.lang.String) , rename sample code for javax.naming.Context.rename(javax.naming.Name, javax.naming.Name) definition code for javax.naming.Context.rename(javax.naming.Name, javax.naming.Name) , rename sample code for javax.naming.Context.rename(java.lang.String, java.lang.String) definition code for javax.naming.Context.rename(java.lang.String, java.lang.String) , unbind sample code for javax.naming.Context.unbind(javax.naming.Name) definition code for javax.naming.Context.unbind(javax.naming.Name) , unbind sample code for javax.naming.Context.unbind(java.lang.String) definition code for javax.naming.Context.unbind(java.lang.String)
 

Constructor Detail

InitialLdapContext sample code for javax.naming.ldap.InitialLdapContext() definition code for javax.naming.ldap.InitialLdapContext()

public InitialLdapContext()
                   throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Constructs an initial context using no environment properties or connection request controls. Equivalent to new InitialLdapContext(null, null).

Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - if a naming exception is encountered

InitialLdapContext sample code for javax.naming.ldap.InitialLdapContext(java.util.Hashtable<?, ?>, javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext(java.util.Hashtable<?, ?>, javax.naming.ldap.Control[])

public InitialLdapContext(Hashtable sample code for java.util.Hashtable definition code for java.util.Hashtable <?,?> environment,
                          Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] connCtls)
                   throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Constructs an initial context using environment properties and connection request controls. See javax.naming.InitialContext for a discussion of environment properties.

This constructor will not modify its parameters or save references to them, but may save a clone or copy.

connCtls is used as the underlying context instance's connection request controls. See the class description for details.

Parameters:
environment - environment used to create the initial DirContext. Null indicates an empty environment.
connCtls - connection request controls for the initial context. If null, no connection request controls are used.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - if a naming exception is encountered
See Also:
reconnect(javax.naming.ldap.Control[]) sample code for javax.naming.ldap.InitialLdapContext.reconnect(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.reconnect(javax.naming.ldap.Control[]) , LdapContext.reconnect(javax.naming.ldap.Control[]) sample code for javax.naming.ldap.LdapContext.reconnect(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.reconnect(javax.naming.ldap.Control[])
Method Detail

extendedOperation sample code for javax.naming.ldap.InitialLdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest) definition code for javax.naming.ldap.InitialLdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest)

public ExtendedResponse sample code for javax.naming.ldap.ExtendedResponse definition code for javax.naming.ldap.ExtendedResponse  extendedOperation(ExtendedRequest sample code for javax.naming.ldap.ExtendedRequest definition code for javax.naming.ldap.ExtendedRequest  request)
                                   throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: LdapContext sample code for javax.naming.ldap.LdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest) definition code for javax.naming.ldap.LdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest)
Performs an extended operation. This method is used to support LDAPv3 extended operations.

Specified by:
extendedOperation sample code for javax.naming.ldap.LdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest) definition code for javax.naming.ldap.LdapContext.extendedOperation(javax.naming.ldap.ExtendedRequest) in interface LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
Parameters:
request - The non-null request to be performed.
Returns:
The possibly null response of the operation. null means the operation did not generate any response.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an error occurred while performing the extended operation.

newInstance sample code for javax.naming.ldap.InitialLdapContext.newInstance(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.newInstance(javax.naming.ldap.Control[])

public LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext  newInstance(Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] reqCtls)
                        throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: LdapContext sample code for javax.naming.ldap.LdapContext.newInstance(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.newInstance(javax.naming.ldap.Control[])
Creates a new instance of this context initialized using request controls. This method is a convenience method for creating a new instance of this context for the purposes of multithreaded access. For example, if multiple threads want to use different context request controls, each thread may use this method to get its own copy of this context and set/get context request controls without having to synchronize with other threads.

The new context has the same environment properties and connection request controls as this context. See the class description for details. Implementations might also allow this context and the new context to share the same network connection or other resources if doing so does not impede the independence of either context.

Specified by:
newInstance sample code for javax.naming.ldap.LdapContext.newInstance(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.newInstance(javax.naming.ldap.Control[]) in interface LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
Parameters:
reqCtls - The possibly null request controls to use for the new context. If null, the context is initialized with no request controls.
Returns:
A non-null LdapContext instance.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an error occurred while creating the new instance.
See Also:
InitialLdapContext sample code for javax.naming.ldap.InitialLdapContext definition code for javax.naming.ldap.InitialLdapContext

reconnect sample code for javax.naming.ldap.InitialLdapContext.reconnect(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.reconnect(javax.naming.ldap.Control[])

public void reconnect(Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] connCtls)
               throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: LdapContext sample code for javax.naming.ldap.LdapContext.reconnect(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.reconnect(javax.naming.ldap.Control[])
Reconnects to the LDAP server using the supplied controls and this context's environment.

This method is a way to explicitly initiate an LDAP "bind" operation. For example, you can use this method to set request controls for the LDAP "bind" operation, or to explicitly connect to the server to get response controls returned by the LDAP "bind" operation.

This method sets this context's connCtls to be its new connection request controls. This context's context request controls are not affected. After this method has been invoked, any subsequent implicit reconnections will be done using connCtls. connCtls are also used as connection request controls for new context instances derived from this context. These connection request controls are not affected by setRequestControls().

Service provider implementors should read the "Service Provider" section in the class description for implementation details.

Specified by:
reconnect sample code for javax.naming.ldap.LdapContext.reconnect(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.reconnect(javax.naming.ldap.Control[]) in interface LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
Parameters:
connCtls - The possibly null controls to use. If null, no controls are used.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an error occurred while reconnecting.
See Also:
LdapContext.getConnectControls() sample code for javax.naming.ldap.LdapContext.getConnectControls() definition code for javax.naming.ldap.LdapContext.getConnectControls() , LdapContext.newInstance(javax.naming.ldap.Control[]) sample code for javax.naming.ldap.LdapContext.newInstance(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.newInstance(javax.naming.ldap.Control[])

getConnectControls sample code for javax.naming.ldap.InitialLdapContext.getConnectControls() definition code for javax.naming.ldap.InitialLdapContext.getConnectControls()

public Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] getConnectControls()
                             throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: LdapContext sample code for javax.naming.ldap.LdapContext.getConnectControls() definition code for javax.naming.ldap.LdapContext.getConnectControls()
Retrieves the connection request controls in effect for this context. The controls are owned by the JNDI implementation and are immutable. Neither the array nor the controls may be modified by the caller.

Specified by:
getConnectControls sample code for javax.naming.ldap.LdapContext.getConnectControls() definition code for javax.naming.ldap.LdapContext.getConnectControls() in interface LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
Returns:
A possibly-null array of controls. null means no connect controls have been set for this context.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an error occurred while getting the request controls.

setRequestControls sample code for javax.naming.ldap.InitialLdapContext.setRequestControls(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.InitialLdapContext.setRequestControls(javax.naming.ldap.Control[])

public void setRequestControls(Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] requestControls)
                        throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: LdapContext sample code for javax.naming.ldap.LdapContext.setRequestControls(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.setRequestControls(javax.naming.ldap.Control[])
Sets the request controls for methods subsequently invoked on this context. The request controls are owned by the JNDI implementation and are immutable. Neither the array nor the controls may be modified by the caller.

This removes any previous request controls and adds requestControls for use by subsequent methods invoked on this context. This method does not affect this context's connection request controls.

Note that requestControls will be in effect until the next invocation of setRequestControls(). You need to explicitly invoke setRequestControls() with null or an empty array to clear the controls if you don't want them to affect the context methods any more. To check what request controls are in effect for this context, use getRequestControls().

Specified by:
setRequestControls sample code for javax.naming.ldap.LdapContext.setRequestControls(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.setRequestControls(javax.naming.ldap.Control[]) in interface LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
Parameters:
requestControls - The possibly null controls to use. If null, no controls are used.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an error occurred while setting the request controls.
See Also:
LdapContext.getRequestControls() sample code for javax.naming.ldap.LdapContext.getRequestControls() definition code for javax.naming.ldap.LdapContext.getRequestControls()

getRequestControls sample code for javax.naming.ldap.InitialLdapContext.getRequestControls() definition code for javax.naming.ldap.InitialLdapContext.getRequestControls()

public Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] getRequestControls()
                             throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: LdapContext sample code for javax.naming.ldap.LdapContext.getRequestControls() definition code for javax.naming.ldap.LdapContext.getRequestControls()
Retrieves the request controls in effect for this context. The request controls are owned by the JNDI implementation and are immutable. Neither the array nor the controls may be modified by the caller.

Specified by:
getRequestControls sample code for javax.naming.ldap.LdapContext.getRequestControls() definition code for javax.naming.ldap.LdapContext.getRequestControls() in interface LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
Returns:
A possibly-null array of controls. null means no request controls have been set for this context.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an error occurred while getting the request controls.
See Also:
LdapContext.setRequestControls(javax.naming.ldap.Control[]) sample code for javax.naming.ldap.LdapContext.setRequestControls(javax.naming.ldap.Control[]) definition code for javax.naming.ldap.LdapContext.setRequestControls(javax.naming.ldap.Control[])

getResponseControls sample code for javax.naming.ldap.InitialLdapContext.getResponseControls() definition code for javax.naming.ldap.InitialLdapContext.getResponseControls()

public Control sample code for javax.naming.ldap.Control definition code for javax.naming.ldap.Control [] getResponseControls()
                              throws NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException 
Description copied from interface: LdapContext sample code for javax.naming.ldap.LdapContext.getResponseControls() definition code for javax.naming.ldap.LdapContext.getResponseControls()
Retrieves the response controls produced as a result of the last method invoked on this context. The response controls are owned by the JNDI implementation and are immutable. Neither the array nor the controls may be modified by the caller.

These response controls might have been generated by a successful or failed operation.

When a context method that may return response controls is invoked, response controls from the previous method invocation are cleared. getResponseControls() returns all of the response controls generated by LDAP operations used by the context method in the order received from the LDAP server. Invoking getResponseControls() does not clear the response controls. You can call it many times (and get back the same controls) until the next context method that may return controls is invoked.

Specified by:
getResponseControls sample code for javax.naming.ldap.LdapContext.getResponseControls() definition code for javax.naming.ldap.LdapContext.getResponseControls() in interface LdapContext sample code for javax.naming.ldap.LdapContext definition code for javax.naming.ldap.LdapContext
Returns:
A possibly null array of controls. If null, the previous method invoked on this context did not produce any controls.
Throws:
NamingException sample code for javax.naming.NamingException definition code for javax.naming.NamingException - If an error occurred while getting the response controls.