Package rocks.xmpp.core.stanza.model.client

Examples of rocks.xmpp.core.stanza.model.client.Presence


                    // Connect
                    xmppSession.connect();
                    // Login
                    xmppSession.login("222", "222", "filetransfer");
                    // Send initial presence
                    xmppSession.send(new Presence());

                    FileTransferManager fileTransferManager = xmppSession.getExtensionManager(FileTransferManager.class);
                    fileTransferManager.addFileTransferOfferListener(new FileTransferOfferListener() {
                        @Override
                        public void fileTransferOffered(FileTransferOfferEvent e) {
View Full Code Here


                    // Connect
                    xmppSession.connect();
                    // Login
                    xmppSession.login("111", "111", "geolocation");
                    // Send initial presence
                    xmppSession.send(new Presence());

//                    GeoLocationManager geoLocationManager = xmppSession.getExtensionManager(GeoLocationManager.class);
//                    geoLocationManager.publish(new GeoLocation(123, 321));

                } catch (IOException | LoginException e) {
View Full Code Here

                "       type='error'>\n" +
                "     <error type='auth'>\n" +
                "       <forbidden xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertEquals(presence.getType(), Presence.Type.ERROR);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.AUTH);
        Assert.assertTrue(presence.getError().getCondition() instanceof Forbidden);
    }
View Full Code Here

                "     <error type='cancel'>\n" +
                "       <internal-server-error\n" +
                "           xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertEquals(presence.getType(), Presence.Type.ERROR);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.CANCEL);
        Assert.assertTrue(presence.getError().getCondition() instanceof InternalServerError);
    }
View Full Code Here

                "             type='error'>\n" +
                "     <error type='cancel'>\n" +
                "       <item-not-found xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertEquals(presence.getType(), Presence.Type.ERROR);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.CANCEL);
        Assert.assertTrue(presence.getError().getCondition() instanceof ItemNotFound);
    }
View Full Code Here

                "            type='modify'>\n" +
                "       <jid-malformed\n" +
                "           xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertEquals(presence.getType(), Presence.Type.ERROR);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.MODIFY);
        Assert.assertTrue(presence.getError().getCondition() instanceof JidMalformed);
    }
View Full Code Here

                "       type='error'>\n" +
                "     <error type='cancel'>\n" +
                "       <not-allowed xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertEquals(presence.getType(), Presence.Type.ERROR);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.CANCEL);
        Assert.assertTrue(presence.getError().getCondition() instanceof NotAllowed);
    }
View Full Code Here

                "       to='juliet@im.example.com/balcony'>\n" +
                "     <error type='auth'>\n" +
                "       <not-authorized xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.AUTH);
        Assert.assertTrue(presence.getError().getCondition() instanceof NotAuthorized);
    }
View Full Code Here

                "     <error type='wait'>\n" +
                "       <recipient-unavailable\n" +
                "           xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'/>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.WAIT);
        Assert.assertTrue(presence.getError().getCondition() instanceof RecipientUnavailable);
    }
View Full Code Here

                "       type='error'>\n" +
                "     <error type='modify'>\n" +
                "       <redirect xmlns='urn:ietf:params:xml:ns:xmpp-stanzas'>xmpp:characters@conference.example.org</redirect>\n" +
                "     </error>\n" +
                "   </presence>";
        Presence presence = unmarshal(xml, Presence.class);
        Assert.assertNotNull(presence.getError());
        Assert.assertEquals(presence.getType(), Presence.Type.ERROR);
        Assert.assertEquals(presence.getError().getType(), StanzaError.Type.MODIFY);
        Assert.assertTrue(presence.getError().getCondition() instanceof Redirect);
        Assert.assertEquals(((Redirect) presence.getError().getCondition()).getAlternateAddress(), "xmpp:characters@conference.example.org");
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.core.stanza.model.client.Presence

Copyright © 2018 www.massapicom. 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.