Class VersionManager

java.lang.Object
org.jivesoftware.smack.Manager
org.jivesoftware.smackx.iqversion.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 Details

    • setDefaultVersion

      public static void setDefaultVersion(String name, String version)
    • setDefaultVersion

      public static void setDefaultVersion(String name, String version, String os)
    • getInstanceFor

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

      public static void setAutoAppendSmackVersion(boolean autoAppendSmackVersion)
    • setVersion

      public void setVersion(String name, String version)
    • setVersion

      public void setVersion(String name, String version, 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, InterruptedException
      Throws:
      org.jivesoftware.smack.SmackException.NoResponseException
      org.jivesoftware.smack.XMPPException.XMPPErrorException
      org.jivesoftware.smack.SmackException.NotConnectedException
      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, 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.
      InterruptedException - if the calling thread was interrupted.