return false;
}
protected Context findNnsContext(Name name) throws NamingException {
CannotProceedException cpe = null;
if (env.containsKey(NamingManager.CPE)) {
cpe = (CannotProceedException) env.get(NamingManager.CPE);
} else {
cpe = new CannotProceedException();
}
String dn = name.get(0);
// seems altName always is "/"
Name altName = new CompositeName();
altName.add("");
// if the dn doesn't exist, throw NameNotFoundException
lookup(dn);
Name resolvedName = cpe.getResolvedName();
if (resolvedName == null) {
resolvedName = new CompositeName();
}
resolvedName.add(dn);
Name remainingName = name.getSuffix(1);
if (remainingName.size() == 1 && remainingName.get(0).equals("")) {
remainingName = new CompositeName();
if (!resolvedName.get(resolvedName.size() - 1).equals("")) {
resolvedName.add("");
}
}
final LdapContextImpl context = new LdapContextImpl(this, env,
composeName(new LdapName(dn), contextDn).toString());
cpe.setAltName(altName);
cpe.setAltNameCtx(context);
cpe.setEnvironment((Hashtable<Object, Object>) env.clone());
cpe.setRemainingName(remainingName);
cpe.setResolvedName(resolvedName);
RefAddr addr = new RefAddr("nns") { //$NON-NLS-1$
private static final long serialVersionUID = -5428706819217461955L;
@Override
public Object getContent() {
return context;
}
};
// class name is always java.lang.Object in RI
Reference ref = new Reference(Object.class.getName(), addr);
cpe.setResolvedObj(ref);
return DirectoryManager.getContinuationDirContext(cpe);
}