Class IoTDiscoveryManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.iot.discovery.IoTDiscoveryManager
-
public final class IoTDiscoveryManager extends Manager
A manager for XEP-0347: Internet of Things - Discovery. Used to register and discover things.- See Also:
- XEP-0347: Internet of Things - Discovery
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IoTClaimedclaimThing(java.util.Collection<Tag> metaTags)IoTClaimedclaimThing(java.util.Collection<Tag> metaTags, boolean publicThing)IoTClaimedclaimThing(Jid registry, java.util.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)JidfindRegistry()Try to find an XMPP IoT registry.static IoTDiscoveryManagergetInstanceFor(XMPPConnection connection)Get the manger instance responsible for the given connection.ThingStategetStateFor(Thing thing)booleanisRegistry(BareJid jid)booleanisRegistry(Jid jid)ThingStateregisterThing(Thing thing)ThingStateregisterThing(Jid registry, Thing thing)voidremoveThing(BareJid thing)voidremoveThing(BareJid thing, NodeInfo nodeInfo)voidremoveThing(Jid registry, BareJid thing, NodeInfo nodeInfo)voidunregister()voidunregister(NodeInfo nodeInfo)voidunregister(Jid registry, NodeInfo nodeInfo)-
Methods inherited from class org.jivesoftware.smack.Manager
connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
-
-
-
-
Method Detail
-
getInstanceFor
public static IoTDiscoveryManager getInstanceFor(XMPPConnection connection)
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, java.lang.InterruptedException
Try to find an XMPP IoT registry.- Returns:
- the JID of a Thing Registry if one could be found,
nullotherwise. - Throws:
java.lang.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:
- XEP-0347 ยง 3.5 Finding Thing Registry
-
registerThing
public ThingState registerThing(Thing thing) throws SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, IoTClaimedException
- Throws:
SmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionIoTClaimedException
-
registerThing
public ThingState registerThing(Jid registry, Thing thing) throws SmackException.NotConnectedException, java.lang.InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, IoTClaimedException
- Throws:
SmackException.NotConnectedExceptionjava.lang.InterruptedExceptionSmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionIoTClaimedException
-
claimThing
public IoTClaimed claimThing(java.util.Collection<Tag> metaTags) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
claimThing
public IoTClaimed claimThing(java.util.Collection<Tag> metaTags, boolean publicThing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
claimThing
public IoTClaimed claimThing(Jid registry, java.util.Collection<Tag> metaTags, boolean publicThing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.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.java.lang.InterruptedException- if the calling thread was interrupted.
-
removeThing
public void removeThing(BareJid thing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
removeThing
public void removeThing(BareJid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
removeThing
public void removeThing(Jid registry, BareJid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
unregister
public void unregister() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
unregister
public void unregister(NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
unregister
public void unregister(Jid registry, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
disownThing
public void disownThing(Jid thing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
disownThing
public void disownThing(Jid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
disownThing
public void disownThing(Jid registry, Jid thing, NodeInfo nodeInfo) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
isRegistry
public boolean isRegistry(BareJid jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseExceptionXMPPException.XMPPErrorExceptionSmackException.NotConnectedExceptionjava.lang.InterruptedException
-
isRegistry
public boolean isRegistry(Jid jid)
-
getStateFor
public ThingState getStateFor(Thing thing)
-
-