JNDI 1.2

javax.naming.directory
Class InitialDirContext

java.lang.Object
  |
  +--javax.naming.InitialContext
        |
        +--javax.naming.directory.InitialDirContext
Direct Known Subclasses:
InitialLdapContext

public class InitialDirContext
extends InitialContext
implements DirContext

This class is the starting context for performing directory operations. The documentation in the class description of InitialContext (including those for synchronization) apply here.

Since:
JNDI 1.1 / Java 2 Platform, Standard Edition, v 1.3
See Also:
InitialContext

Fields inherited from class javax.naming.InitialContext
defaultInitCtx, gotDefault, myProps
 
Constructor Summary
  InitialDirContext()
          Constructs an initial DirContext.
protected InitialDirContext(boolean lazy)
          Constructs an initial DirContext with the option of not initializing it.
  InitialDirContext(Hashtable environment)
          Constructs an initial DirContext using the supplied environment.
 
Method Summary
 void bind(Name name, Object obj, Attributes attrs)
          Binds a name to an object, along with associated attributes.
 void bind(String name, Object obj, Attributes attrs)
          Binds a name to an object, along with associated attributes.
 DirContext createSubcontext(Name name, Attributes attrs)
          Creates and binds a new context, along with associated attributes.
 DirContext createSubcontext(String name, Attributes attrs)
          Creates and binds a new context, along with associated attributes.
 Attributes getAttributes(Name name)
          Retrieves selected attributes associated with a named object.
 Attributes getAttributes(Name name, String[] attrIds)
          Retrieves selected attributes associated with a named object.
 Attributes getAttributes(String name)
          Retrieves all of the attributes associated with a named object.
 Attributes getAttributes(String name, String[] attrIds)
          Retrieves all of the attributes associated with a named object.
 DirContext getSchema(Name name)
          Retrieves the schema associated with the named object.
 DirContext getSchema(String name)
          Retrieves the schema associated with the named object.
 DirContext getSchemaClassDefinition(Name name)
          Retrieves a context containing the schema objects of the named object's class definitions.
 DirContext getSchemaClassDefinition(String name)
          Retrieves a context containing the schema objects of the named object's class definitions.
 void modifyAttributes(Name name, int mod_op, Attributes attrs)
          Modifies the attributes associated with a named object.
 void modifyAttributes(Name name, ModificationItem[] mods)
          Modifies the attributes associated with a named object using an an ordered list of modifications.
 void modifyAttributes(String name, int mod_op, Attributes attrs)
          Modifies the attributes associated with a named object.
 void modifyAttributes(String name, ModificationItem[] mods)
          Modifies the attributes associated with a named object using an an ordered list of modifications.
 void rebind(Name name, Object obj, Attributes attrs)
          Binds a name to an object, along with associated attributes, overwriting any existing binding.
 void rebind(String name, Object obj, Attributes attrs)
          Binds a name to an object, along with associated attributes, overwriting any existing binding.
 NamingEnumeration search(Name name, Attributes matchingAttributes)
          Searches in a single context for objects that contain a specified set of attributes.
 NamingEnumeration search(Name name, Attributes matchingAttributes, String[] attributesToReturn)
          Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes.
 NamingEnumeration search(Name name, String filterExpr, Object[] filterArgs, SearchControls cons)
          Searches in the named context or object for entries that satisfy the given search filter.
 NamingEnumeration search(Name name, String filter, SearchControls cons)
          Searches in the named context or object for entries that satisfy the given search filter.
 NamingEnumeration search(String name, Attributes matchingAttributes)
          Searches in a single context for objects that contain a specified set of attributes.
 NamingEnumeration search(String name, Attributes matchingAttributes, String[] attributesToReturn)
          Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes.
 NamingEnumeration search(String name, String filterExpr, Object[] filterArgs, SearchControls cons)
          Searches in the named context or object for entries that satisfy the given search filter.
 NamingEnumeration search(String name, String filter, SearchControls cons)
          Searches in the named context or object for entries that satisfy the given search filter.
 
Methods inherited from class javax.naming.InitialContext
addToEnvironment, bind, bind, close, composeName, composeName, createSubcontext, createSubcontext, destroySubcontext, destroySubcontext, getDefaultInitCtx, getEnvironment, getNameInNamespace, getNameParser, getNameParser, getURLOrDefaultInitCtx, getURLOrDefaultInitCtx, init, list, list, listBindings, listBindings, lookup, lookup, lookupLink, lookupLink, rebind, rebind, removeFromEnvironment, rename, rename, unbind, unbind
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

InitialDirContext

protected InitialDirContext(boolean lazy)
                     throws NamingException
Constructs an initial DirContext with the option of not initializing it. This may be used by a constructor in a subclass when the value of the environment parameter is not yet known at the time the InitialDirContext constructor is called. The subclass's constructor will call this constructor, compute the value of the environment, and then call init() before returning.
Parameters:
lazy - true means do not initialize the initial DirContext; false is equivalent to calling new InitialDirContext()
Throws:
NamingException - if a naming exception is encountered
Since:
JNDI 1.2 / Java 2 Platform, Standard Edition, v 1.3
See Also:
InitialContext.init(Hashtable)

InitialDirContext

public InitialDirContext()
                  throws NamingException
Constructs an initial DirContext. No environment properties are supplied. Equivalent to new InitialDirContext(null).
Throws:
NamingException - if a naming exception is encountered
See Also:
InitialDirContext(Hashtable)

InitialDirContext

public InitialDirContext(Hashtable environment)
                  throws NamingException
Constructs an initial DirContext using the supplied environment. Environment properties are discussed in the javax.naming.InitialContext class description.

This constructor will not modify environment or save a reference to it, but may save a clone.

Parameters:
environment - environment used to create the initial DirContext. Null indicates an empty environment.
Throws:
NamingException - if a naming exception is encountered
Method Detail

getAttributes

public Attributes getAttributes(String name)
                         throws NamingException
Retrieves all of the attributes associated with a named object.
Specified by:
getAttributes in interface DirContext

getAttributes

public Attributes getAttributes(String name,
                                String[] attrIds)
                         throws NamingException
Retrieves all of the attributes associated with a named object.
Specified by:
getAttributes in interface DirContext

getAttributes

public Attributes getAttributes(Name name)
                         throws NamingException
Retrieves selected attributes associated with a named object.
Specified by:
getAttributes in interface DirContext

getAttributes

public Attributes getAttributes(Name name,
                                String[] attrIds)
                         throws NamingException
Retrieves selected attributes associated with a named object.
Specified by:
getAttributes in interface DirContext

modifyAttributes

public void modifyAttributes(String name,
                             int mod_op,
                             Attributes attrs)
                      throws NamingException
Modifies the attributes associated with a named object.
Specified by:
modifyAttributes in interface DirContext

modifyAttributes

public void modifyAttributes(Name name,
                             int mod_op,
                             Attributes attrs)
                      throws NamingException
Modifies the attributes associated with a named object.
Specified by:
modifyAttributes in interface DirContext

modifyAttributes

public void modifyAttributes(String name,
                             ModificationItem[] mods)
                      throws NamingException
Modifies the attributes associated with a named object using an an ordered list of modifications.
Specified by:
modifyAttributes in interface DirContext

modifyAttributes

public void modifyAttributes(Name name,
                             ModificationItem[] mods)
                      throws NamingException
Modifies the attributes associated with a named object using an an ordered list of modifications.
Specified by:
modifyAttributes in interface DirContext

bind

public void bind(String name,
                 Object obj,
                 Attributes attrs)
          throws NamingException
Binds a name to an object, along with associated attributes.
Specified by:
bind in interface DirContext

bind

public void bind(Name name,
                 Object obj,
                 Attributes attrs)
          throws NamingException
Binds a name to an object, along with associated attributes.
Specified by:
bind in interface DirContext

rebind

public void rebind(String name,
                   Object obj,
                   Attributes attrs)
            throws NamingException
Binds a name to an object, along with associated attributes, overwriting any existing binding.
Specified by:
rebind in interface DirContext

rebind

public void rebind(Name name,
                   Object obj,
                   Attributes attrs)
            throws NamingException
Binds a name to an object, along with associated attributes, overwriting any existing binding.
Specified by:
rebind in interface DirContext

createSubcontext

public DirContext createSubcontext(String name,
                                   Attributes attrs)
                            throws NamingException
Creates and binds a new context, along with associated attributes.
Specified by:
createSubcontext in interface DirContext

createSubcontext

public DirContext createSubcontext(Name name,
                                   Attributes attrs)
                            throws NamingException
Creates and binds a new context, along with associated attributes.
Specified by:
createSubcontext in interface DirContext

getSchema

public DirContext getSchema(String name)
                     throws NamingException
Retrieves the schema associated with the named object.
Specified by:
getSchema in interface DirContext

getSchema

public DirContext getSchema(Name name)
                     throws NamingException
Retrieves the schema associated with the named object.
Specified by:
getSchema in interface DirContext

getSchemaClassDefinition

public DirContext getSchemaClassDefinition(String name)
                                    throws NamingException
Retrieves a context containing the schema objects of the named object's class definitions.
Specified by:
getSchemaClassDefinition in interface DirContext

getSchemaClassDefinition

public DirContext getSchemaClassDefinition(Name name)
                                    throws NamingException
Retrieves a context containing the schema objects of the named object's class definitions.
Specified by:
getSchemaClassDefinition in interface DirContext

search

public NamingEnumeration search(String name,
                                Attributes matchingAttributes)
                         throws NamingException
Searches in a single context for objects that contain a specified set of attributes.
Specified by:
search in interface DirContext

search

public NamingEnumeration search(Name name,
                                Attributes matchingAttributes)
                         throws NamingException
Searches in a single context for objects that contain a specified set of attributes.
Specified by:
search in interface DirContext

search

public NamingEnumeration search(String name,
                                Attributes matchingAttributes,
                                String[] attributesToReturn)
                         throws NamingException
Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes.
Specified by:
search in interface DirContext

search

public NamingEnumeration search(Name name,
                                Attributes matchingAttributes,
                                String[] attributesToReturn)
                         throws NamingException
Searches in a single context for objects that contain a specified set of attributes, and retrieves selected attributes.
Specified by:
search in interface DirContext

search

public NamingEnumeration search(String name,
                                String filter,
                                SearchControls cons)
                         throws NamingException
Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls.
Specified by:
search in interface DirContext

search

public NamingEnumeration search(Name name,
                                String filter,
                                SearchControls cons)
                         throws NamingException
Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls.
Specified by:
search in interface DirContext

search

public NamingEnumeration search(String name,
                                String filterExpr,
                                Object[] filterArgs,
                                SearchControls cons)
                         throws NamingException
Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls.
Specified by:
search in interface DirContext

search

public NamingEnumeration search(Name name,
                                String filterExpr,
                                Object[] filterArgs,
                                SearchControls cons)
                         throws NamingException
Searches in the named context or object for entries that satisfy the given search filter. Performs the search as specified by the search controls.
Specified by:
search in interface DirContext

JNDI 1.2

For more information on JNDI, please see http://java.sun.com/products/jndi