Search in sources :

Example 26 with Jid

use of org.jxmpp.jid.Jid in project Smack by igniterealtime.

the class MultiUserChatLightManager method getRoomsBlocked.

/**
     * Get rooms blocked.
     * 
     * @param mucLightService
     * @return the list of rooms blocked
     * @throws NoResponseException
     * @throws XMPPErrorException
     * @throws NotConnectedException
     * @throws InterruptedException
     */
public List<Jid> getRoomsBlocked(DomainBareJid mucLightService) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
    MUCLightBlockingIQ muclIghtBlockingIQResult = getBlockingList(mucLightService);
    List<Jid> jids = new ArrayList<>();
    if (muclIghtBlockingIQResult.getRooms() != null) {
        jids.addAll(muclIghtBlockingIQResult.getRooms().keySet());
    }
    return jids;
}
Also used : Jid(org.jxmpp.jid.Jid) DomainBareJid(org.jxmpp.jid.DomainBareJid) EntityBareJid(org.jxmpp.jid.EntityBareJid) MUCLightBlockingIQ(org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ) ArrayList(java.util.ArrayList)

Example 27 with Jid

use of org.jxmpp.jid.Jid in project Smack by igniterealtime.

the class MultiUserChatLightManager method unblockUsers.

/**
     * Unblock users.
     * 
     * @param mucLightService
     * @param usersJids
     * @throws NoResponseException
     * @throws XMPPErrorException
     * @throws NotConnectedException
     * @throws InterruptedException
     */
public void unblockUsers(DomainBareJid mucLightService, List<Jid> usersJids) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
    HashMap<Jid, Boolean> users = new HashMap<>();
    for (Jid jid : usersJids) {
        users.put(jid, true);
    }
    sendUnblockUsers(mucLightService, users);
}
Also used : Jid(org.jxmpp.jid.Jid) DomainBareJid(org.jxmpp.jid.DomainBareJid) EntityBareJid(org.jxmpp.jid.EntityBareJid) HashMap(java.util.HashMap) WeakHashMap(java.util.WeakHashMap)

Example 28 with Jid

use of org.jxmpp.jid.Jid in project Smack by igniterealtime.

the class MUCLightAffiliationsIQ method getIQChildElementBuilder.

@Override
protected IQChildElementXmlStringBuilder getIQChildElementBuilder(IQChildElementXmlStringBuilder xml) {
    xml.rightAngleBracket();
    xml.optElement("version", version);
    Iterator<Map.Entry<Jid, MUCLightAffiliation>> it = affiliations.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry<Jid, MUCLightAffiliation> pair = it.next();
        xml.element(new UserWithAffiliationElement(pair.getKey(), pair.getValue()));
    }
    return xml;
}
Also used : MUCLightAffiliation(org.jivesoftware.smackx.muclight.MUCLightAffiliation) Jid(org.jxmpp.jid.Jid) UserWithAffiliationElement(org.jivesoftware.smackx.muclight.element.MUCLightElements.UserWithAffiliationElement) Map(java.util.Map) HashMap(java.util.HashMap)

Example 29 with Jid

use of org.jxmpp.jid.Jid in project Smack by igniterealtime.

the class MUCLightBlockingIQ method parseBlocking.

private void parseBlocking(IQChildElementXmlStringBuilder xml, HashMap<Jid, Boolean> map, boolean isRoom) {
    Iterator<Map.Entry<Jid, Boolean>> it = map.entrySet().iterator();
    while (it.hasNext()) {
        Map.Entry<Jid, Boolean> pair = it.next();
        xml.element(new BlockingElement(pair.getKey(), pair.getValue(), isRoom));
    }
}
Also used : BlockingElement(org.jivesoftware.smackx.muclight.element.MUCLightElements.BlockingElement) Jid(org.jxmpp.jid.Jid) Map(java.util.Map) HashMap(java.util.HashMap)

Example 30 with Jid

use of org.jxmpp.jid.Jid in project Smack by igniterealtime.

the class IoTDisownProvider method parse.

@Override
public IoTDisown parse(XmlPullParser parser, int initialDepth) throws Exception {
    Jid jid = ParserUtils.getJidAttribute(parser);
    NodeInfo nodeInfo = NodeInfoParser.parse(parser);
    return new IoTDisown(jid, nodeInfo);
}
Also used : Jid(org.jxmpp.jid.Jid) NodeInfo(org.jivesoftware.smackx.iot.element.NodeInfo) IoTDisown(org.jivesoftware.smackx.iot.discovery.element.IoTDisown)

Aggregations

Jid (org.jxmpp.jid.Jid)78 EntityBareJid (org.jxmpp.jid.EntityBareJid)18 ArrayList (java.util.ArrayList)15 HashMap (java.util.HashMap)14 Test (org.junit.Test)14 DomainBareJid (org.jxmpp.jid.DomainBareJid)14 EntityFullJid (org.jxmpp.jid.EntityFullJid)12 BareJid (org.jxmpp.jid.BareJid)11 IQ (org.jivesoftware.smack.packet.IQ)7 Presence (org.jivesoftware.smack.packet.Presence)7 MUCLightBlockingIQ (org.jivesoftware.smackx.muclight.element.MUCLightBlockingIQ)7 SmackException (org.jivesoftware.smack.SmackException)6 Message (org.jivesoftware.smack.packet.Message)6 WeakHashMap (java.util.WeakHashMap)4 XMPPConnection (org.jivesoftware.smack.XMPPConnection)4 Map (java.util.Map)3 SimpleResultSyncPoint (org.igniterealtime.smack.inttest.util.SimpleResultSyncPoint)3 FeatureNotSupportedException (org.jivesoftware.smack.SmackException.FeatureNotSupportedException)3 XMPPErrorException (org.jivesoftware.smack.XMPPException.XMPPErrorException)3 Bytestream (org.jivesoftware.smackx.bytestreams.socks5.packet.Bytestream)3