Package org.xmpp.packet

Examples of org.xmpp.packet.Presence.toXML()


                Presence presence = (Presence)packet;
                if (Presence.Type.error == presence.getType()) {
                    // A configuration must be wrong (eg. workgroup is not allowed to create rooms).
                    // Log the error presence
                    String warnMessage = "Possible server misconfiguration. Received error " +
                        "presence:" + presence.toXML();
                    Log.warn(warnMessage);
                    return;
                }
                // Get the JID of the presence's user
                Element mucUser = presence.getChildElement("x", "http://jabber.org/protocol/muc#user");
View Full Code Here


    public void testFilterAvailablePresence() throws Exception {
       
        // setup available presence
        Presence presence = new Presence();
        presence.setStatus("fox is now online!");
        System.out.println(presence.toXML());
       
        // filter on the word "fox" and "dog"
        filter.setPatterns("fox,dog");
        filter.setMask("**");
       
View Full Code Here

       
        String expectedXML = presenceXML.replaceAll("fox", filter.getMask());
        // do filter
        boolean matched = filter.filter(p);       
        assertTrue(matched);
        assertEquals(expectedXML, expectedXML, p.toXML());
       
    }
}
View Full Code Here

        catch (Exception e) {}
        try {
            presence.setTo(new JID(request.getParameter("req_jid")));
        }
        catch (Exception e) {}
        out.println(presence.toXML());
        out.flush();
    }
}
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.