Search in sources :

Example 1 with IoTRemove

use of org.jivesoftware.smackx.iot.discovery.element.IoTRemove in project Smack by igniterealtime.

the class IoTDiscoveryManager method removeThing.

public void removeThing(Jid registry, BareJid thing, NodeInfo nodeInfo) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
    interactWithRegistry(registry);
    IoTRemove iotRemove = new IoTRemove(thing, nodeInfo);
    iotRemove.setTo(registry);
    connection().createStanzaCollectorAndSend(iotRemove).nextResultOrThrow();
// We no not update the ThingState here, as this is done in the <removed/> IQ handler above.;
}
Also used : IoTRemove(org.jivesoftware.smackx.iot.discovery.element.IoTRemove)

Example 2 with IoTRemove

use of org.jivesoftware.smackx.iot.discovery.element.IoTRemove in project Smack by igniterealtime.

the class IoTRemoveProvider method parse.

@Override
public IoTRemove parse(XmlPullParser parser, int initialDepth) throws Exception {
    Jid jid = ParserUtils.getJidAttribute(parser);
    if (jid.hasResource()) {
        throw new SmackException("JID must be without resourcepart");
    }
    BareJid bareJid = jid.asBareJid();
    NodeInfo nodeInfo = NodeInfoParser.parse(parser);
    return new IoTRemove(bareJid, nodeInfo);
}
Also used : IoTRemove(org.jivesoftware.smackx.iot.discovery.element.IoTRemove) Jid(org.jxmpp.jid.Jid) BareJid(org.jxmpp.jid.BareJid) BareJid(org.jxmpp.jid.BareJid) NodeInfo(org.jivesoftware.smackx.iot.element.NodeInfo) SmackException(org.jivesoftware.smack.SmackException)

Aggregations

IoTRemove (org.jivesoftware.smackx.iot.discovery.element.IoTRemove)2 SmackException (org.jivesoftware.smack.SmackException)1 NodeInfo (org.jivesoftware.smackx.iot.element.NodeInfo)1 BareJid (org.jxmpp.jid.BareJid)1 Jid (org.jxmpp.jid.Jid)1