Package org.jivesoftware.smack.packet

Examples of org.jivesoftware.smack.packet.Packet.toXML()


            stream.print("<packet type=\"received\" date=\"");
          else
            stream.print("<packet type=\"sent\" date=\"");
          stream.print(dateFormat.format(wrapper.date));
          stream.print("\">");
          stream.println(packet.toXML());
          stream.println("</packet>");
        }
      } catch(InterruptedException e) {
        e.printStackTrace();
        closeAllWriter();
View Full Code Here


            // Write out packets from the queue.
            while (!done && (writerThread == thisThread)) {
                Packet packet = nextPacket();
                if (packet != null) {
                    synchronized (writer) {
                        writer.write(packet.toXML());
                        writer.flush();
                        // Keep track of the last time a stanza was sent to the server
                        lastActive = System.currentTimeMillis();
                    }
                }
View Full Code Here

            // by the shutdown process.
            try {
                synchronized (writer) {
                   while (!queue.isEmpty()) {
                       Packet packet = queue.remove();
                        writer.write(packet.toXML());
                    }
                    writer.flush();
                }
            }
            catch (Exception e) {
View Full Code Here

                .a("xml:lang", "sp")
                .t("This is a test of the emergency broadcast system, 3.")
            .asString(outputProperties);
       
        Packet message = PacketParserUtils.parseMessage(getParser(control));
        assertXMLEqual(control, message.toXML());
    }

    private XmlPullParser getParser(String control) throws XmlPullParserException, IOException {
        XmlPullParser parser = new MXParser();
        parser.setInput(new StringReader(control));
View Full Code Here

            if (printProtocol) {
                System.out.println("------------------- Request -------------\n");
                System.out.println(prettyFormat(request.toXML()));
                System.out.println("------------------- Response ------------\n");
                if (response != null) {
                    System.out.println(prettyFormat(response.toXML()));
                }
                else {
                    System.out.println("No response");
                }
            }
View Full Code Here

                .append(sessionID)
                .append("\">");

        for (Iterator<Packet> it=packets.iterator(); it.hasNext();) {
            Packet packet = it.next();
            buf.append(packet.toXML());
        }

        buf.append("</transcript>");

        return buf.toString();
View Full Code Here

    public void verifyForm() throws Exception
    {
  FileTransferNegotiator fileNeg = FileTransferNegotiator.getInstanceFor(connection);
  fileNeg.negotiateOutgoingTransfer("me", "streamid", "file", 1024, null, 10);
  Packet packet = connection.getSentPacket();
  assertTrue(packet.toXML().indexOf("\"stream-method\" type=\"list-single\"") != -1);
    }
}
View Full Code Here

            // Write out packets from the queue.
            while (!done && (writerThread == thisThread)) {
                Packet packet = nextPacket();
                if (packet != null) {
                    synchronized (writer) {
                        writer.write(packet.toXML());
                        writer.flush();
                        // Keep track of the last time a stanza was sent to the server
                        lastActive = System.currentTimeMillis();
                    }
                }
View Full Code Here

            // by the shutdown process.
            try {
                synchronized (writer) {
                   while (!queue.isEmpty()) {
                       Packet packet = queue.remove();
                        writer.write(packet.toXML());
                    }
                    writer.flush();
                }
            }
            catch (Exception e) {
View Full Code Here

                .append(sessionID)
                .append("\">");

        for (Iterator it=packets.iterator(); it.hasNext();) {
            Packet packet = (Packet) it.next();
            buf.append(packet.toXML());
        }

        buf.append("</transcript>");

        return buf.toString();
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.