Class VersionManager
- java.lang.Object
-
- org.jivesoftware.smack.Manager
-
- org.jivesoftware.smackx.iqversion.VersionManager
-
public final class VersionManager extends 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(XMPPConnection connection)
Version
getVersion(Jid jid)
Request version information from a given JID.boolean
isSupported(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
-
-
-
-
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(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(Jid jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, SmackException.NotConnectedException, java.lang.InterruptedException
- Throws:
SmackException.NoResponseException
XMPPException.XMPPErrorException
SmackException.NotConnectedException
java.lang.InterruptedException
-
getVersion
public Version getVersion(Jid jid) throws SmackException.NoResponseException, XMPPException.XMPPErrorException, 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:
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.
-
-