Search in sources :

Example 1 with IoTUnregister

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

the class IoTDiscoveryManager method unregister.

public void unregister(Jid registry, NodeInfo nodeInfo) throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
    interactWithRegistry(registry);
    IoTUnregister iotUnregister = new IoTUnregister(nodeInfo);
    iotUnregister.setTo(registry);
    connection().createStanzaCollectorAndSend(iotUnregister).nextResultOrThrow();
    ThingState state = getStateFor(nodeInfo);
    state.setUnregistered();
    final XMPPConnection connection = connection();
    IoTDataManager.getInstanceFor(connection).uninstallThing(nodeInfo);
    IoTControlManager.getInstanceFor(connection).uninstallThing(nodeInfo);
}
Also used : XMPPConnection(org.jivesoftware.smack.XMPPConnection) IoTUnregister(org.jivesoftware.smackx.iot.discovery.element.IoTUnregister)

Aggregations

XMPPConnection (org.jivesoftware.smack.XMPPConnection)1 IoTUnregister (org.jivesoftware.smackx.iot.discovery.element.IoTUnregister)1