Examples of toXml()


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

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

        public void processPacket(Packet packet) {
            Presence presence = (Presence) packet;
            String iqString = presence.toString();
            final PacketExtension extension = presence.getExtension("http://jabber.org/protocol/caps");
            if (extension != null)
                System.out.println("T" + System.currentTimeMillis() + " Pres: " + iqString + ": " + presence.toXML());
        }
    }

    public static void main(String[] args) throws XMPPException {
View Full Code Here

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

    /**
     * Check the creation of a new xmppError locally.
    */
    public void testLocalErrorCreation() {
      XMPPError error = new XMPPError(XMPPError.Condition.item_not_found);
        error.toXML();

      assertEquals(error.getCondition(), "item-not-found");
      assertEquals(error.getCode(), 404);
      assertEquals(error.getType(), XMPPError.Type.CANCEL);
      assertNull(error.getMessage());
View Full Code Here

Examples of org.jivesoftware.smackx.FormField.toXML()

            buf.append(item.toXML());
        }
        // Loop through all the form fields and append them to the string buffer
        for (Iterator i = getFields(); i.hasNext();) {
            FormField field = (FormField) i.next();
            buf.append(field.toXML());
        }
        buf.append("</").append(getElementName()).append(">");
        return buf.toString();
    }
View Full Code Here

Examples of org.jivesoftware.smackx.RemoteRosterEntry.toXML()

        buf.append("<").append(getElementName()).append(" xmlns=\"").append(getNamespace()).append(
            "\">");
        // Loop through all roster entries and append them to the string buffer
        for (Iterator i = getRosterEntries(); i.hasNext();) {
            RemoteRosterEntry remoteRosterEntry = (RemoteRosterEntry) i.next();
            buf.append(remoteRosterEntry.toXML());
        }
        buf.append("</").append(getElementName()).append(">");
        return buf.toString();
    }
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Close.toXML()

        Close close = new Close("i781hf64");
        close.setFrom("romeo@montague.lit/orchard");
        close.setTo("juliet@capulet.lit/balcony");
        close.setPacketID("us71g45j");
       
        assertXMLEqual(control, close.toXML());
    }

}
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Data.toXML()

        Data data = new Data(dpe);
        data.setFrom("romeo@montague.lit/orchard");
        data.setTo("juliet@capulet.lit/balcony");
        data.setPacketID("kr91n475");
       
        assertXMLEqual(control, data.toXML());
    }

}
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.DataPacketExtension.toXML()

            .a("xmlns", "http://jabber.org/protocol/ibb")
            .a("seq", "0")
            .a("sid", "i781hf64")
            .t(encodedData)
            .asString(outputProperties);
        when(dpe.toXML()).thenReturn(dataTag);
        Data data = new Data(dpe);
        data.setFrom("romeo@montague.lit/orchard");
        data.setTo("juliet@capulet.lit/balcony");
        data.setPacketID("kr91n475");
       
View Full Code Here

Examples of org.jivesoftware.smackx.bytestreams.ibb.packet.Open.toXML()

        Open open = new Open("i781hf64", 4096, StanzaType.IQ);
        open.setFrom("romeo@montague.lit/orchard");
        open.setTo("juliet@capulet.lit/balcony");
        open.setPacketID("jn3h8g65");
       
        assertXMLEqual(control, open.toXML());
    }
   
   
}
View Full Code Here

Examples of org.jivesoftware.smackx.packet.DiscoverInfo.toXML()

        assertNotNull(u1ver);

        DiscoverInfo entityInfo = EntityCapsManager.caps.get(u1ver);
        assertNotNull(entityInfo);

        assertEquals(info.toXML(), entityInfo.toXML());
    }

    private static void dropWholeEntityCapsCache() {
        EntityCapsManager.caps.clear();
        EntityCapsManager.jidCaps.clear();
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.