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 IoTClaimed
claimThing(Collection<Tag> metaTags)
IoTClaimed
claimThing(Collection<Tag> metaTags, boolean publicThing)
IoTClaimed
claimThing(Jid registry, Collection<Tag> metaTags, boolean publicThing)
Claim a thing by providing a collection of meta tags.void
disownThing(Jid thing)
void
disownThing(Jid thing, NodeInfo nodeInfo)
void
disownThing(Jid registry, Jid thing, NodeInfo nodeInfo)
Jid
findRegistry()
Try to find an XMPP IoT registry.static IoTDiscoveryManager
getInstanceFor(XMPPConnection connection)
Get the manger instance responsible for the given connection.ThingState
getStateFor(Thing thing)
boolean
isRegistry(BareJid jid)
boolean
isRegistry(Jid jid)
ThingState
registerThing(Thing thing)
ThingState
registerThing(Jid registry, Thing thing)
void
removeThing(BareJid thing)
void
removeThing(BareJid thing, NodeInfo nodeInfo)
void
removeThing(Jid registry, BareJid thing, NodeInfo nodeInfo)
void
unregister()
void
unregister(NodeInfo nodeInfo)
void
unregister(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, InterruptedException
Try to find an XMPP IoT registry.- Returns:
- the JID of a Thing Registry if one could be found,
null
otherwise. - 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:
- XEP-0347 ยง 3.5 Finding Thing Registry
-
registerThing
public ThingState registerThing(Thing thing) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, IoTClaimedException
-
registerThing
public ThingState registerThing(Jid registry, Thing thing) throws SmackException.NotConnectedException, InterruptedException, SmackException.NoResponseException, XMPPException.XMPPErrorException, IoTClaimedException
-
claimThing
public IoTClaimed claimThing(Collection<Tag> metaTags) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
-
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 aIoTClaimed
instance 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
IoTClaimed
if 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
public void removeThing(BareJid thing) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
-
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
public void unregister() throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, InterruptedException
-
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
public boolean isRegistry(Jid jid)
-
getStateFor
public ThingState getStateFor(Thing thing)
-
-