Class IoTDiscoveryManager
java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.iot.discovery.IoTDiscoveryManager
A manager for XEP-0347: Internet of Things - Discovery. Used to register and discover things.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionclaimThing(Collection<Tag> metaTags) claimThing(Collection<Tag> metaTags, boolean publicThing) claimThing(Jid registry, Collection<Tag> metaTags, boolean publicThing) Claim a thing by providing a collection of meta tags.voiddisownThing(Jid thing) voiddisownThing(Jid thing, NodeInfo nodeInfo) voiddisownThing(Jid registry, Jid thing, NodeInfo nodeInfo) Try to find an XMPP IoT registry.static IoTDiscoveryManagergetInstanceFor(XMPPConnection connection) Get the manger instance responsible for the given connection.getStateFor(Thing thing) booleanisRegistry(BareJid jid) booleanisRegistry(Jid jid) registerThing(Thing thing) registerThing(Jid registry, Thing thing) voidremoveThing(BareJid thing) voidremoveThing(BareJid thing, NodeInfo nodeInfo) voidremoveThing(Jid registry, BareJid thing, NodeInfo nodeInfo) voidvoidunregister(NodeInfo nodeInfo) voidunregister(Jid registry, NodeInfo nodeInfo) Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
Method Details
-
getInstanceFor
Get the manger instance responsible for the given connection.- Parameters:
connection- the XMPP connection.- Returns:
- a manager instance.
-
findRegistry
public Jid findRegistry() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedExceptionTry to find an XMPP IoT registry.- Returns:
- the JID of a Thing Registry if one could be found,
nullotherwise. - Throws:
InterruptedException- if the calling thread was interrupted.SmackException.NotConnectedException- if the XMPP connection is not connected.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NoResponseException- if there was no response from the remote entity.- See Also:
-
registerThing
-
registerThing
public ThingState registerThing(Jid registry, Thing thing) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, IoTClaimedException -
claimThing
-
claimThing
public IoTClaimed claimThing(Collection<Tag> metaTags, boolean publicThing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
claimThing
public IoTClaimed claimThing(Jid registry, Collection<Tag> metaTags, boolean publicThing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException Claim a thing by providing a collection of meta tags. If the claim was successful, then aIoTClaimedinstance will be returned, which contains the XMPP address of the thing. UseIoTClaimed.getJid()to retrieve this address.- Parameters:
registry- the registry use to claim the thing.metaTags- a collection of meta tags used to identify the thing.publicThing- if this is a public thing.- Returns:
- a
IoTClaimedif successful. - Throws:
SmackException.NoResponseException- if there was no response from the remote entity.XMPPException.XMPPErrorException- if there was an XMPP error returned.SmackException.NotConnectedException- if the XMPP connection is not connected.InterruptedException- if the calling thread was interrupted.
-
removeThing
-
removeThing
public void removeThing(BareJid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
removeThing
public void removeThing(Jid registry, BareJid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
unregister
-
unregister
public void unregister(NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
unregister
public void unregister(Jid registry, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
disownThing
public void disownThing(Jid thing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
disownThing
public void disownThing(Jid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
disownThing
public void disownThing(Jid registry, Jid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
isRegistry
public boolean isRegistry(BareJid jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException -
isRegistry
-
getStateFor
-