private XmlNode getChildren(XmlNode method) { String dn = method.getChildText("dn"); XmlNode result = new XmlNode("GetChildrenResponse"); // System.out.println(dn+index.get(dn)); XmlNode ldap = null; String tmp = dn; while (ldap == null && tmp.indexOf(",") > 0) { ldap = index.get(tmp); tmp = tmp.substring(tmp.indexOf(",") + 1); } for (XmlNode child : ldap.getChild("children").getChildren()) result.add("tuple").add("old").add(child.getChild("entry").clone()); return result; }
private XmlNode getObject(XmlNode method) { String dn = method.getChildText("dn"); XmlNode result = new XmlNode("GetLDAPObjectResponse"); XmlNode ldap = index.get(dn); XmlNode entry; if (ldap == null) { entry = new XmlNode("entry"); entry.setAttribute("dn", dn); entry.add("objectclass").add("string").setText("top"); } else entry = ldap.getChild("entry").clone(); result.add("tuple").add("old").add(entry); return result; }
private void addFromXmlDump(XmlNode ldap) { XmlNode entry = ldap.getChild("entry"); String dn = entry.getAttribute("dn"); index.put(dn, ldap); for (XmlNode n : ldap.getChild("children").getChildren()) addFromXmlDump(n); }
public DummyCaller(XmlNode dump) { this.dump = dump; addFromXmlDump(dump.getChild("ldap")); }