public class Version extends IQ
An example to discover the version of the server:
// Request the version from the server.
Version versionRequest = new Version();
timeRequest.setType(IQ.Type.GET);
timeRequest.setTo("example.com");
// Create a packet collector to listen for a response.
PacketCollector collector = con.createPacketCollector(
new PacketIDFilter(versionRequest.getPacketID()));
con.sendPacket(versionRequest);
// Wait up to 5 seconds for a result.
IQ result = (IQ)collector.nextResult(5000);
if (result != null && result.getType() == IQ.Type.RESULT) {
Version versionResult = (Version)result;
// Do something with result...
}ID_NOT_AVAILABLE| Constructor and Description |
|---|
Version() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getChildElementXML()
Returns the sub-element XML section of the IQ packet, or null if there
isn't one.
|
java.lang.String |
getName()
Returns the natural-language name of the software.
|
java.lang.String |
getOs()
Returns the operating system of the queried entity.
|
java.lang.String |
getVersion()
Returns the specific version of the software.
|
void |
setName(java.lang.String name)
Sets the natural-language name of the software.
|
void |
setOs(java.lang.String os)
Sets the operating system of the queried entity.
|
void |
setVersion(java.lang.String version)
Sets the specific version of the software.
|
addExtension, deleteProperty, getError, getExtension, getExtensions, getExtensionsXML, getFrom, getPacketID, getProperty, getPropertyNames, getTo, removeExtension, setError, setFrom, setPacketID, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setTopublic java.lang.String getName()
public void setName(java.lang.String name)
name - the natural-language name of the software.public java.lang.String getVersion()
public void setVersion(java.lang.String version)
version - the specific version of the software.public java.lang.String getOs()
public void setOs(java.lang.String os)
os - operating system of the queried entity.public java.lang.String getChildElementXML()
IQExtensions of this class must override this method.
getChildElementXML in class IQCopyright © 2003 Jive Software.