FileDocCategorySizeDatePackage
InitialDirContext.javaAPI DocJava SE 5 API8363Fri Aug 26 14:57:40 BST 2005javax.naming.directory

InitialDirContext

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.
author
Rosanna Lee
author
Scott Seligman
version
1.11 04/07/16
see
javax.naming.InitialContext
since
1.3

Fields Summary
Constructors Summary
protected InitialDirContext(boolean lazy)
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.

param
lazy true means do not initialize the initial DirContext; false is equivalent to calling new InitialDirContext()
throws
NamingException if a naming exception is encountered
see
InitialContext#init(Hashtable)
since
1.3

	super(lazy);
    
public InitialDirContext()
Constructs an initial DirContext. No environment properties are supplied. Equivalent to new InitialDirContext(null).

throws
NamingException if a naming exception is encountered
see
#InitialDirContext(Hashtable)

	super();
    
public InitialDirContext(Hashtable environment)
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.

param
environment environment used to create the initial DirContext. Null indicates an empty environment.
throws
NamingException if a naming exception is encountered

	super(environment);
    
Methods Summary
public voidbind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)

	getURLOrDefaultInitDirCtx(name).bind(name, obj, attrs);
    
public voidbind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)

	getURLOrDefaultInitDirCtx(name).bind(name, obj, attrs);
    
public javax.naming.directory.DirContextcreateSubcontext(java.lang.String name, javax.naming.directory.Attributes attrs)

	return getURLOrDefaultInitDirCtx(name).createSubcontext(name, attrs);
    
public javax.naming.directory.DirContextcreateSubcontext(javax.naming.Name name, javax.naming.directory.Attributes attrs)

	return getURLOrDefaultInitDirCtx(name).createSubcontext(name, attrs);
    
public javax.naming.directory.AttributesgetAttributes(java.lang.String name)

	return getAttributes(name, null);
    
public javax.naming.directory.AttributesgetAttributes(java.lang.String name, java.lang.String[] attrIds)

	return getURLOrDefaultInitDirCtx(name).getAttributes(name, attrIds);
    
public javax.naming.directory.AttributesgetAttributes(javax.naming.Name name)

	return getAttributes(name, null);
    
public javax.naming.directory.AttributesgetAttributes(javax.naming.Name name, java.lang.String[] attrIds)

	return getURLOrDefaultInitDirCtx(name).getAttributes(name, attrIds);
    
public javax.naming.directory.DirContextgetSchema(java.lang.String name)

	return getURLOrDefaultInitDirCtx(name).getSchema(name);
    
public javax.naming.directory.DirContextgetSchema(javax.naming.Name name)

	return getURLOrDefaultInitDirCtx(name).getSchema(name);
    
public javax.naming.directory.DirContextgetSchemaClassDefinition(java.lang.String name)

	return getURLOrDefaultInitDirCtx(name).getSchemaClassDefinition(name);
    
public javax.naming.directory.DirContextgetSchemaClassDefinition(javax.naming.Name name)

	return getURLOrDefaultInitDirCtx(name).getSchemaClassDefinition(name);
    
private javax.naming.directory.DirContextgetURLOrDefaultInitDirCtx(java.lang.String name)

	Context answer = getURLOrDefaultInitCtx(name);
	if (!(answer instanceof DirContext)) {
	    if (answer == null) {
		throw new NoInitialContextException();
	    } else {
		throw new NotContextException(
		    "Not an instance of DirContext");
	    }
	}
	return (DirContext)answer;
    
private javax.naming.directory.DirContextgetURLOrDefaultInitDirCtx(javax.naming.Name name)

	Context answer = getURLOrDefaultInitCtx(name);
	if (!(answer instanceof DirContext)) {
	    if (answer == null) {
		throw new NoInitialContextException();
	    } else {
		throw new NotContextException(
		    "Not an instance of DirContext");
	    }
	}
	return (DirContext)answer;
    
public voidmodifyAttributes(java.lang.String name, int mod_op, javax.naming.directory.Attributes attrs)

	getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mod_op, attrs);
    
public voidmodifyAttributes(javax.naming.Name name, int mod_op, javax.naming.directory.Attributes attrs)

	getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mod_op, attrs);
    
public voidmodifyAttributes(java.lang.String name, javax.naming.directory.ModificationItem[] mods)

	getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mods);
    
public voidmodifyAttributes(javax.naming.Name name, javax.naming.directory.ModificationItem[] mods)

	getURLOrDefaultInitDirCtx(name).modifyAttributes(name, mods);
    
public voidrebind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)

	getURLOrDefaultInitDirCtx(name).rebind(name, obj, attrs);
    
public voidrebind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)

	getURLOrDefaultInitDirCtx(name).rebind(name, obj, attrs);
    
public javax.naming.NamingEnumerationsearch(java.lang.String name, javax.naming.directory.Attributes matchingAttributes)

	return getURLOrDefaultInitDirCtx(name).search(name, matchingAttributes);
    
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes)

	return getURLOrDefaultInitDirCtx(name).search(name, matchingAttributes);
    
public javax.naming.NamingEnumerationsearch(java.lang.String name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)

	return getURLOrDefaultInitDirCtx(name).search(name, 
						      matchingAttributes,
						      attributesToReturn);
    
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)

	return getURLOrDefaultInitDirCtx(name).search(name, 
					    matchingAttributes,
					    attributesToReturn);
    
public javax.naming.NamingEnumerationsearch(java.lang.String name, java.lang.String filter, javax.naming.directory.SearchControls cons)

	return getURLOrDefaultInitDirCtx(name).search(name, filter, cons);
    
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, java.lang.String filter, javax.naming.directory.SearchControls cons)

	return getURLOrDefaultInitDirCtx(name).search(name, filter, cons);
    
public javax.naming.NamingEnumerationsearch(java.lang.String name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)

	return getURLOrDefaultInitDirCtx(name).search(name, filterExpr, 
						      filterArgs, cons);
    
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, java.lang.String filterExpr, java.lang.Object[] filterArgs, javax.naming.directory.SearchControls cons)

	return getURLOrDefaultInitDirCtx(name).search(name, filterExpr, 
						      filterArgs, cons);