Package rocks.xmpp.extensions.blocking.model

Examples of rocks.xmpp.extensions.blocking.model.BlockList


     * @throws rocks.xmpp.core.session.NoResponseException  If the entity did not respond.
     * @see <a href="http://xmpp.org/extensions/xep-0191.html#blocklist">3.2 User Retrieves Block List</a>
     */
    public Collection<Jid> getBlockedContacts() throws XmppException {
        synchronized (blockedContacts) {
            IQ result = xmppSession.query(new IQ(IQ.Type.GET, new BlockList()));
            BlockList blockList = result.getExtension(BlockList.class);
            if (blockList != null) {
                for (Jid item : blockList.getItems()) {
                    blockedContacts.add(item);
                }
            }
            return blockedContacts;
        }
View Full Code Here


                "    <item jid='romeo@montague.net'/>\n" +
                "    <item jid='iago@shakespeare.lit'/>\n" +
                "  </blocklist>\n" +
                "</iq>";
        IQ iq = unmarshal(xml, IQ.class);
        BlockList blockList = iq.getExtension(BlockList.class);
        Assert.assertEquals(blockList.getItems().size(), 2);
        Assert.assertEquals(blockList.getItems().get(0), Jid.valueOf("romeo@montague.net"));
        Assert.assertEquals(blockList.getItems().get(1), Jid.valueOf("iago@shakespeare.lit"));
        Assert.assertNotNull(blockList);
    }
View Full Code Here

TOP

Related Classes of rocks.xmpp.extensions.blocking.model.BlockList

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.