예제 #1
0
 public EntryObjective(Organization org, ObjectiveBase parent, String propName, XmlNode node) {
   this.org = org;
   this.parent = parent;
   this.propName = propName;
   this.isvpName = node.getAttribute("isvp", null);
   this.name = node.getAttribute("name");
 }
예제 #2
0
 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;
 }
예제 #3
0
 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;
 }
예제 #4
0
  public XmlNode call(XmlNode method, String org, String processor) {
    Environment env = Environment.get();
    if (env.debug) env.debug(method.getPretty());
    XmlNode output;
    if (method.getName().equals("GetLDAPObject")) output = getObject(method);
    else if (method.getName().equals("GetChildren")) output = getChildren(method);
    else if (method.getName().equals("GetVersion")) output = getVersion();
    else throw new RuntimeException("Unknown calls " + method.getPretty());

    if (env.debug) env.debug(output.getPretty());
    return output;
  }
예제 #5
0
 private XmlNode getVersion() {
   XmlNode env = new XmlNode("Envelope");
   XmlNode comp = env.add("Header").add("header").add("sender").add("component");
   comp.setText("cn=LDAP Service,cn=soap nodes,o=system," + dump.getChildText("ldap/@dn"));
   XmlNode result = env.add("Body").add("GetVersionResponse");
   result.add("version").setText(dump.getAttribute("version"));
   result.add("build").setText(dump.getAttribute("build"));
   // System.out.println(env.getPretty());
   return result;
 }
예제 #6
0
 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);
 }
예제 #7
0
 public DummyCaller(XmlNode dump) {
   this.dump = dump;
   addFromXmlDump(dump.getChild("ldap"));
 }
예제 #8
0
 public String getName() {
   return dump.getAttribute("name");
 }