Package tigase.xml

Examples of tigase.xml.Element.addChildren()


    switch (packet.getCommand()) {
    case GETFEATURES:
      if (packet.getType() == StanzaType.result) {
        List<Element> features = getFeatures(getXMPPSession(packet));
        Element elem_features = new Element("stream:features");
        elem_features.addChildren(features);
        elem_features.addChildren(Command.getData(packet));
        Packet result = new Packet(elem_features);
        result.setTo(packet.getTo());
        writePacketToSocket(result);
      } // end of if (packet.getType() == StanzaType.get)
View Full Code Here


    case GETFEATURES:
      if (packet.getType() == StanzaType.result) {
        List<Element> features = getFeatures(getXMPPSession(packet));
        Element elem_features = new Element("stream:features");
        elem_features.addChildren(features);
        elem_features.addChildren(Command.getData(packet));
        Packet result = new Packet(elem_features);
        result.setTo(packet.getTo());
        writePacketToSocket(result);
      } // end of if (packet.getType() == StanzaType.get)
      break;
View Full Code Here

        if (isLocalDomain(jid)) {
          query = getDiscoInfo(node, jid);
          for (XMPPService comp: xmppServices.values()) {
            List<Element> features = comp.getDiscoFeatures();
            if (features != null) {
              query.addChildren(features);
            }
          } // end of for ()
        } else {
          for (XMPPService comp: xmppServices.values()) {
            //            if (jid.startsWith(comp.getName() + ".")) {
View Full Code Here

      query_rep = query.clone();
      List<Element> items =
        serviceEntity.getDiscoItems(JIDUtils.getNodeNick(packet.getElemTo()),
          packet.getElemTo());
      if (items != null && items.size() > 0) {
        query_rep.addChildren(items);
      } // end of if (items != null && items.size() > 0)
      processed = true;
    } // end of if (query != null && packet.getType() == StanzaType.get)
    if (query_rep != null) {
      addOutPacket(packet.okResult(query_rep, 0));
View Full Code Here

    if (jid != null && getName().equals(JIDUtils.getNodeNick(jid))) {
      Element query = serviceEntity.getDiscoInfo(node);
      for (ProcessorThread proc_t: processors.values()) {
        Element[] discoFeatures = proc_t.processor.supDiscoFeatures(null);
        if (discoFeatures != null) {
          query.addChildren(Arrays.asList(discoFeatures));
        } // end of if (discoFeatures != null)
      }
      return query;
    }
    return null;
View Full Code Here

    } // end of if (getElemTo() != null)
    if (getElemId() != null) {
      reply.setAttribute("id", getElemId());
    } // end of if (getElemId() != null)
    if (includeOriginalXML) {
      reply.addChildren(elem.getChildren());
    } // end of if (includeOriginalXML)
    if (getAttribute(OLDTO) != null) {
      reply.setAttribute(OLDTO, getAttribute(OLDTO));
    }
    if(getAttribute("xmlns") != null){
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.