Class IoTDiscoveryManager


  • public final class IoTDiscoveryManager
    extends org.jivesoftware.smack.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 Detail

      • getInstanceFor

        public static IoTDiscoveryManager getInstanceFor​(org.jivesoftware.smack.XMPPConnection connection)
        Get the manger instance responsible for the given connection.
        Parameters:
        connection - the XMPP connection.
        Returns:
        a manager instance.
      • findRegistry

        public org.jxmpp.jid.Jid findRegistry()
                                       throws org.jivesoftware.smack.SmackException.NoResponseException,
                                              org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                              org.jivesoftware.smack.SmackException.NotConnectedException,
                                              java.lang.InterruptedException
        Try to find an XMPP IoT registry.
        Returns:
        the JID of a Thing Registry if one could be found, null otherwise.
        Throws:
        java.lang.InterruptedException - if the calling thread was interrupted.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.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 org.jivesoftware.smack.SmackException.NotConnectedException,
                                        java.lang.InterruptedException,
                                        org.jivesoftware.smack.SmackException.NoResponseException,
                                        org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                        IoTClaimedException
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        IoTClaimedException
      • registerThing

        public ThingState registerThing​(org.jxmpp.jid.Jid registry,
                                        Thing thing)
                                 throws org.jivesoftware.smack.SmackException.NotConnectedException,
                                        java.lang.InterruptedException,
                                        org.jivesoftware.smack.SmackException.NoResponseException,
                                        org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                        IoTClaimedException
        Throws:
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        IoTClaimedException
      • claimThing

        public IoTClaimed claimThing​(java.util.Collection<Tag> metaTags)
                              throws org.jivesoftware.smack.SmackException.NoResponseException,
                                     org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                     org.jivesoftware.smack.SmackException.NotConnectedException,
                                     java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • claimThing

        public IoTClaimed claimThing​(java.util.Collection<Tag> metaTags,
                                     boolean publicThing)
                              throws org.jivesoftware.smack.SmackException.NoResponseException,
                                     org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                     org.jivesoftware.smack.SmackException.NotConnectedException,
                                     java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • claimThing

        public IoTClaimed claimThing​(org.jxmpp.jid.Jid registry,
                                     java.util.Collection<Tag> metaTags,
                                     boolean publicThing)
                              throws org.jivesoftware.smack.SmackException.NoResponseException,
                                     org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                     org.jivesoftware.smack.SmackException.NotConnectedException,
                                     java.lang.InterruptedException
        Claim a thing by providing a collection of meta tags. If the claim was successful, then a IoTClaimed instance will be returned, which contains the XMPP address of the thing. Use IoTClaimed.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:
        org.jivesoftware.smack.SmackException.NoResponseException - if there was no response from the remote entity.
        org.jivesoftware.smack.XMPPException.XMPPErrorException - if there was an XMPP error returned.
        org.jivesoftware.smack.SmackException.NotConnectedException - if the XMPP connection is not connected.
        java.lang.InterruptedException - if the calling thread was interrupted.
      • removeThing

        public void removeThing​(org.jxmpp.jid.BareJid thing)
                         throws org.jivesoftware.smack.SmackException.NoResponseException,
                                org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                org.jivesoftware.smack.SmackException.NotConnectedException,
                                java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • removeThing

        public void removeThing​(org.jxmpp.jid.BareJid thing,
                                NodeInfo nodeInfo)
                         throws org.jivesoftware.smack.SmackException.NoResponseException,
                                org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                org.jivesoftware.smack.SmackException.NotConnectedException,
                                java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • removeThing

        public void removeThing​(org.jxmpp.jid.Jid registry,
                                org.jxmpp.jid.BareJid thing,
                                NodeInfo nodeInfo)
                         throws org.jivesoftware.smack.SmackException.NoResponseException,
                                org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                org.jivesoftware.smack.SmackException.NotConnectedException,
                                java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • unregister

        public void unregister()
                        throws org.jivesoftware.smack.SmackException.NoResponseException,
                               org.jivesoftware.smack.XMPPException.XMPPErrorException,
                               org.jivesoftware.smack.SmackException.NotConnectedException,
                               java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • unregister

        public void unregister​(NodeInfo nodeInfo)
                        throws org.jivesoftware.smack.SmackException.NoResponseException,
                               org.jivesoftware.smack.XMPPException.XMPPErrorException,
                               org.jivesoftware.smack.SmackException.NotConnectedException,
                               java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • unregister

        public void unregister​(org.jxmpp.jid.Jid registry,
                               NodeInfo nodeInfo)
                        throws org.jivesoftware.smack.SmackException.NoResponseException,
                               org.jivesoftware.smack.XMPPException.XMPPErrorException,
                               org.jivesoftware.smack.SmackException.NotConnectedException,
                               java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • disownThing

        public void disownThing​(org.jxmpp.jid.Jid thing)
                         throws org.jivesoftware.smack.SmackException.NoResponseException,
                                org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                org.jivesoftware.smack.SmackException.NotConnectedException,
                                java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • disownThing

        public void disownThing​(org.jxmpp.jid.Jid thing,
                                NodeInfo nodeInfo)
                         throws org.jivesoftware.smack.SmackException.NoResponseException,
                                org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                org.jivesoftware.smack.SmackException.NotConnectedException,
                                java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • disownThing

        public void disownThing​(org.jxmpp.jid.Jid registry,
                                org.jxmpp.jid.Jid thing,
                                NodeInfo nodeInfo)
                         throws org.jivesoftware.smack.SmackException.NoResponseException,
                                org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                org.jivesoftware.smack.SmackException.NotConnectedException,
                                java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • isRegistry

        public boolean isRegistry​(org.jxmpp.jid.BareJid jid)
                           throws org.jivesoftware.smack.SmackException.NoResponseException,
                                  org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                  org.jivesoftware.smack.SmackException.NotConnectedException,
                                  java.lang.InterruptedException
        Throws:
        org.jivesoftware.smack.SmackException.NoResponseException
        org.jivesoftware.smack.XMPPException.XMPPErrorException
        org.jivesoftware.smack.SmackException.NotConnectedException
        java.lang.InterruptedException
      • isRegistry

        public boolean isRegistry​(org.jxmpp.jid.Jid jid)