FileDocCategorySizeDatePackage
ContinuationDirContext.javaAPI DocJava SE 5 API9956Fri Aug 26 14:57:42 BST 2005javax.naming.spi

ContinuationDirContext

public class ContinuationDirContext extends ContinuationContext implements DirContext
This class is the continuation context for invoking DirContext methods.
author
Rosanna Lee
author
Scott Seligman
version
1.8 03/12/19
since
1.3

Fields Summary
Constructors Summary
ContinuationDirContext(CannotProceedException cpe, Hashtable env)

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

	    DirContextNamePair res = getTargetContext(name);
	    res.getDirContext().bind(res.getName(), obj, attrs);
	
public voidbind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)

	    DirContextStringPair res = getTargetContext(name);
	    res.getDirContext().bind(res.getString(), obj, attrs);
	
public javax.naming.directory.DirContextcreateSubcontext(javax.naming.Name name, javax.naming.directory.Attributes attrs)

	    DirContextNamePair res = getTargetContext(name);
	    return res.getDirContext().createSubcontext(res.getName(), attrs);
	
public javax.naming.directory.DirContextcreateSubcontext(java.lang.String name, javax.naming.directory.Attributes attrs)

	    DirContextStringPair res = getTargetContext(name);
	    return
		res.getDirContext().createSubcontext(res.getString(), attrs);
	
public javax.naming.directory.AttributesgetAttributes(java.lang.String name)

	DirContextStringPair res = getTargetContext(name);
	return res.getDirContext().getAttributes(res.getString());
    
public javax.naming.directory.AttributesgetAttributes(java.lang.String name, java.lang.String[] attrIds)

	    DirContextStringPair res = getTargetContext(name);
	    return res.getDirContext().getAttributes(res.getString(), attrIds);
	
public javax.naming.directory.AttributesgetAttributes(javax.naming.Name name)

	DirContextNamePair res = getTargetContext(name);
	return res.getDirContext().getAttributes(res.getName());
    
public javax.naming.directory.AttributesgetAttributes(javax.naming.Name name, java.lang.String[] attrIds)

	    DirContextNamePair res = getTargetContext(name);
	    return res.getDirContext().getAttributes(res.getName(), attrIds);
	
public javax.naming.directory.DirContextgetSchema(java.lang.String name)

	DirContextStringPair res = getTargetContext(name);
	return res.getDirContext().getSchema(res.getString());
    
public javax.naming.directory.DirContextgetSchema(javax.naming.Name name)

	DirContextNamePair res = getTargetContext(name);
	return res.getDirContext().getSchema(res.getName());
    
public javax.naming.directory.DirContextgetSchemaClassDefinition(java.lang.String name)

	DirContextStringPair res = getTargetContext(name);
	return res.getDirContext().getSchemaClassDefinition(res.getString());
    
public javax.naming.directory.DirContextgetSchemaClassDefinition(javax.naming.Name name)

	DirContextNamePair res = getTargetContext(name);
	return res.getDirContext().getSchemaClassDefinition(res.getName());
    
protected javax.naming.spi.DirContextNamePairgetTargetContext(javax.naming.Name name)


	if (cpe.getResolvedObj() == null)
	    throw (NamingException)cpe.fillInStackTrace();

	Context ctx = NamingManager.getContext(cpe.getResolvedObj(),
					       cpe.getAltName(),
					       cpe.getAltNameCtx(),
					       env);
	if (ctx == null)
	    throw (NamingException)cpe.fillInStackTrace();

	if (ctx instanceof DirContext)
	    return new DirContextNamePair((DirContext)ctx, name);

	if (ctx instanceof Resolver) {
	    Resolver res = (Resolver)ctx;
	    ResolveResult rr = res.resolveToClass(name, DirContext.class);

	    // Reached a DirContext; return result.
	    DirContext dctx = (DirContext)rr.getResolvedObj();
	    return (new DirContextNamePair(dctx, rr.getRemainingName()));
	}

	// Resolve all the way using lookup().  This may allow the operation
	// to succeed if it doesn't require the penultimate context.
	Object ultimate = ctx.lookup(name);
	if (ultimate instanceof DirContext) {
	    return (new DirContextNamePair((DirContext)ultimate,
					  new CompositeName()));
	}

	throw (NamingException)cpe.fillInStackTrace();
    
protected javax.naming.spi.DirContextStringPairgetTargetContext(java.lang.String name)


	if (cpe.getResolvedObj() == null)
	    throw (NamingException)cpe.fillInStackTrace();

	Context ctx = NamingManager.getContext(cpe.getResolvedObj(),
					       cpe.getAltName(),
					       cpe.getAltNameCtx(),
					       env);

	if (ctx instanceof DirContext)
	    return new DirContextStringPair((DirContext)ctx, name);

	if (ctx instanceof Resolver) {
	    Resolver res = (Resolver)ctx;
	    ResolveResult rr = res.resolveToClass(name, DirContext.class);

	    // Reached a DirContext; return result.
	    DirContext dctx = (DirContext)rr.getResolvedObj();
	    Name tmp = rr.getRemainingName();
	    String remains = (tmp != null) ? tmp.toString() : "";
	    return (new DirContextStringPair(dctx, remains));
	}

	// Resolve all the way using lookup().  This may allow the operation
	// to succeed if it doesn't require the penultimate context.
	Object ultimate = ctx.lookup(name);
	if (ultimate instanceof DirContext) {
	    return (new DirContextStringPair((DirContext)ultimate, ""));
	}

	throw (NamingException)cpe.fillInStackTrace();
    
public voidmodifyAttributes(javax.naming.Name name, javax.naming.directory.ModificationItem[] mods)

	    DirContextNamePair res = getTargetContext(name);
	    res.getDirContext().modifyAttributes(res.getName(), mods);
	
public voidmodifyAttributes(java.lang.String name, javax.naming.directory.ModificationItem[] mods)

	    DirContextStringPair res = getTargetContext(name);
	    res.getDirContext().modifyAttributes(res.getString(), mods);
	
public voidmodifyAttributes(javax.naming.Name name, int mod_op, javax.naming.directory.Attributes attrs)

	    DirContextNamePair res = getTargetContext(name);
	    res.getDirContext().modifyAttributes(res.getName(), mod_op, attrs);
	
public voidmodifyAttributes(java.lang.String name, int mod_op, javax.naming.directory.Attributes attrs)

	    DirContextStringPair res = getTargetContext(name);
	    res.getDirContext().modifyAttributes(res.getString(), mod_op, attrs);
	
public voidrebind(javax.naming.Name name, java.lang.Object obj, javax.naming.directory.Attributes attrs)

	    DirContextNamePair res = getTargetContext(name);
	    res.getDirContext().rebind(res.getName(), obj, attrs);
	
public voidrebind(java.lang.String name, java.lang.Object obj, javax.naming.directory.Attributes attrs)

	    DirContextStringPair res = getTargetContext(name);
	    res.getDirContext().rebind(res.getString(), obj, attrs);
	
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)

	    DirContextNamePair res = getTargetContext(name);
	    return res.getDirContext().search(res.getName(), matchingAttributes,
					     attributesToReturn);
	
public javax.naming.NamingEnumerationsearch(java.lang.String name, javax.naming.directory.Attributes matchingAttributes, java.lang.String[] attributesToReturn)

	    DirContextStringPair res = getTargetContext(name);
	    return res.getDirContext().search(res.getString(),
					     matchingAttributes,
					     attributesToReturn);
	
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, javax.naming.directory.Attributes matchingAttributes)

	    DirContextNamePair res = getTargetContext(name);
	    return res.getDirContext().search(res.getName(), matchingAttributes);
	
public javax.naming.NamingEnumerationsearch(java.lang.String name, javax.naming.directory.Attributes matchingAttributes)

	    DirContextStringPair res = getTargetContext(name);
	    return res.getDirContext().search(res.getString(),
					     matchingAttributes);
	
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, java.lang.String filter, javax.naming.directory.SearchControls cons)

	    DirContextNamePair res = getTargetContext(name);
	    return res.getDirContext().search(res.getName(), filter, cons);
	
public javax.naming.NamingEnumerationsearch(java.lang.String name, java.lang.String filter, javax.naming.directory.SearchControls cons)

	    DirContextStringPair res = getTargetContext(name);
	    return res.getDirContext().search(res.getString(), filter, cons);
	
public javax.naming.NamingEnumerationsearch(javax.naming.Name name, java.lang.String filterExpr, java.lang.Object[] args, javax.naming.directory.SearchControls cons)

	    DirContextNamePair res = getTargetContext(name);
	    return res.getDirContext().search(res.getName(), filterExpr, args,
					     cons);
	
public javax.naming.NamingEnumerationsearch(java.lang.String name, java.lang.String filterExpr, java.lang.Object[] args, javax.naming.directory.SearchControls cons)

	    DirContextStringPair res = getTargetContext(name);
	    return res.getDirContext().search(res.getString(), filterExpr, args,
					     cons);