Class VersionManager


  • public final class VersionManager
    extends org.jivesoftware.smack.Manager
    A Version Manager that automatically responds to version IQs with a predetermined reply.

    The VersionManager takes care of handling incoming version request IQs, according to XEP-0092 (Software Version). You can configure the version reply for a given connection by running the following code:

     Version MY_VERSION = new Version("My Little XMPP Application", "v1.23", "OS/2 32-bit");
     VersionManager.getInstanceFor(mConnection).setVersion(MY_VERSION);
     
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static VersionManager getInstanceFor​(org.jivesoftware.smack.XMPPConnection connection)  
      Version getVersion​(org.jxmpp.jid.Jid jid)
      Request version information from a given JID.
      boolean isSupported​(org.jxmpp.jid.Jid jid)  
      static void setAutoAppendSmackVersion​(boolean autoAppendSmackVersion)  
      static void setDefaultVersion​(java.lang.String name, java.lang.String version)  
      static void setDefaultVersion​(java.lang.String name, java.lang.String version, java.lang.String os)  
      void setVersion​(java.lang.String name, java.lang.String version)  
      void setVersion​(java.lang.String name, java.lang.String version, java.lang.String os)  
      void unsetVersion()  
      • Methods inherited from class org.jivesoftware.smack.Manager

        connection, getAuthenticatedConnectionOrThrow, schedule, schedule, scheduleBlocking
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • setDefaultVersion

        public static void setDefaultVersion​(java.lang.String name,
                                             java.lang.String version)
      • setDefaultVersion

        public static void setDefaultVersion​(java.lang.String name,
                                             java.lang.String version,
                                             java.lang.String os)
      • getInstanceFor

        public static VersionManager getInstanceFor​(org.jivesoftware.smack.XMPPConnection connection)
      • setAutoAppendSmackVersion

        public static void setAutoAppendSmackVersion​(boolean autoAppendSmackVersion)
      • setVersion

        public void setVersion​(java.lang.String name,
                               java.lang.String version)
      • setVersion

        public void setVersion​(java.lang.String name,
                               java.lang.String version,
                               java.lang.String os)
      • unsetVersion

        public void unsetVersion()
      • isSupported

        public boolean isSupported​(org.jxmpp.jid.Jid 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
      • getVersion

        public Version getVersion​(org.jxmpp.jid.Jid jid)
                           throws org.jivesoftware.smack.SmackException.NoResponseException,
                                  org.jivesoftware.smack.XMPPException.XMPPErrorException,
                                  org.jivesoftware.smack.SmackException.NotConnectedException,
                                  java.lang.InterruptedException
        Request version information from a given JID.
        Parameters:
        jid - TODO javadoc me please
        Returns:
        the version information or null if not supported by JID
        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.