Package rocks.xmpp.extensions.muc.model.owner

Examples of rocks.xmpp.extensions.muc.model.owner.MucOwner


     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     * @see <a href="http://xmpp.org/extensions/xep-0045.html#createroom-instant">10.1.2 Creating an Instant Room</a>
     */
    public void createRoom() throws XmppException {
        enter(nick);
        xmppSession.query(new IQ(roomJid, IQ.Type.SET, new MucOwner(new DataForm(DataForm.Type.SUBMIT))));
    }
View Full Code Here


     * @see rocks.xmpp.extensions.muc.model.RoomConfigurationForm
     * @see <a href="http://xmpp.org/extensions/xep-0045.html#createroom-reserved">10.1.3 Creating a Reserved Room</a>
     * @see #submitConfigurationForm(rocks.xmpp.extensions.data.model.DataForm)
     */
    public DataForm getConfigurationForm() throws XmppException {
        IQ result = xmppSession.query(new IQ(roomJid, IQ.Type.GET, new MucOwner()));
        MucOwner mucOwner = result.getExtension(MucOwner.class);
        return mucOwner.getConfigurationForm();
    }
View Full Code Here

            throw new IllegalArgumentException("Data Form must be of type 'submit' or 'cancel'");
        }
        if (!"http://jabber.org/protocol/muc#roomconfig".equals(dataForm.getFormType())) {
            throw new IllegalArgumentException("Data Form is not of type 'http://jabber.org/protocol/muc#roomconfig'");
        }
        MucOwner mucOwner = new MucOwner(dataForm);
        IQ iq = new IQ(roomJid, IQ.Type.SET, mucOwner);
        xmppSession.query(iq);
    }
View Full Code Here

     * @throws rocks.xmpp.core.stanza.model.StanzaException If the chat service returned a stanza error.
     * @throws rocks.xmpp.core.session.NoResponseException  If the chat service did not respond.
     * @see <a href="http://xmpp.org/extensions/xep-0045.html#destroyroom">10.9 Destroying a Room</a>
     */
    public void destroy(String reason) throws XmppException {
        MucOwner mucOwner = MucOwner.withDestroy(roomJid, reason);
        IQ iq = new IQ(roomJid, IQ.Type.SET, mucOwner);
        xmppSession.query(iq);
    }
View Full Code Here

        Assert.assertEquals(mucAdmin.getItems().get(0).getReason(), "Treason");
    }

    @Test
    public void marshalCreateInstantRoom() throws JAXBException, XMLStreamException {
        MucOwner mucOwner = new MucOwner(new DataForm(DataForm.Type.SUBMIT));
        String xml = marshal(mucOwner);
        Assert.assertEquals(xml, "<query xmlns=\"http://jabber.org/protocol/muc#owner\"><x xmlns=\"jabber:x:data\" type=\"submit\"></x></query>");
    }
View Full Code Here

        Assert.assertEquals(xml, "<query xmlns=\"http://jabber.org/protocol/muc#owner\"><x xmlns=\"jabber:x:data\" type=\"submit\"></x></query>");
    }

    @Test
    public void marshalRequestConfigurationForm() throws JAXBException, XMLStreamException {
        MucOwner mucOwner = new MucOwner();
        String xml = marshal(mucOwner);
        Assert.assertEquals(xml, "<query xmlns=\"http://jabber.org/protocol/muc#owner\"></query>");
    }
View Full Code Here

                "      <title>Configuration for \"coven\" Room</title>\n" +
                "    </x>\n" +
                "  </query>\n" +
                "</iq>\n";
        IQ iq = unmarshal(xml, IQ.class);
        MucOwner mucOwner = iq.getExtension(MucOwner.class);
        Assert.assertNotNull(mucOwner);
        Assert.assertNotNull(mucOwner.getConfigurationForm());
    }
View Full Code Here

        Assert.assertNotNull(mucOwner.getConfigurationForm());
    }

    @Test
    public void marshalDestroyRoom() throws JAXBException, XMLStreamException {
        MucOwner mucOwner = MucOwner.withDestroy(Jid.valueOf("coven@chat.shakespeare.lit"), "Macbeth doth come.");
        String xml = marshal(mucOwner);
        Assert.assertEquals(xml, "<query xmlns=\"http://jabber.org/protocol/muc#owner\"><destroy jid=\"coven@chat.shakespeare.lit\"><reason>Macbeth doth come.</reason></destroy></query>");
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.muc.model.owner.MucOwner

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.