Class SoftwareInformation
- java.lang.Object
-
- rocks.xmpp.extensions.softwareinfo.SoftwareInformation
-
- All Implemented Interfaces:
StandardizedDataForm
,SoftwareInfo
public final class SoftwareInformation extends Object implements StandardizedDataForm, SoftwareInfo
Represents a view of the standardized fields of the 'urn:xmpp:dataforms:softwareinfo' data form to be included in service discovery responses to provide detailed information about the software.This class is immutable.
- See Also:
- 5.1 Field Standardization
-
-
Constructor Summary
Constructors Constructor Description SoftwareInformation(Media icon, String software, String softwareVersion)
Creates a new Software Info data form, where the OS name and version are automatically taken from their respective system properties "os.name" and "os.version".SoftwareInformation(Media icon, String software, String softwareVersion, String os, String osVersion)
Creates a new Software Info data form.SoftwareInformation(DataForm dataForm)
Creates a software info from a data form.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DataForm
getDataForm()
Gets the underlying data form.String
getFormType()
Gets the form type of the data form.Media
getIcon()
A default icon to show for a device running the software.String
getOs()
The operating system on which the XMPP software is running.String
getOsVersion()
Gets the operating system version.String
getSoftware()
Gets the XMPP software running at the entity.String
getSoftwareVersion()
Gets the XMPP software version.String
toString()
-
-
-
Constructor Detail
-
SoftwareInformation
public SoftwareInformation(Media icon, String software, String softwareVersion)
Creates a new Software Info data form, where the OS name and version are automatically taken from their respective system properties "os.name" and "os.version".- Parameters:
icon
- A default icon to show for a device running the software.software
- The XMPP software running at the entity.softwareVersion
- The XMPP software version.
-
SoftwareInformation
public SoftwareInformation(Media icon, String software, String softwareVersion, String os, String osVersion)
Creates a new Software Info data form.- Parameters:
icon
- A default icon to show for a device running the software.software
- The XMPP software running at the entity.softwareVersion
- The XMPP software version.os
- The operating system on which the XMPP software is running.osVersion
- The operating system version.
-
SoftwareInformation
public SoftwareInformation(DataForm dataForm)
Creates a software info from a data form.- Parameters:
dataForm
- The data form.- Throws:
IllegalArgumentException
- If the data form's form type is not 'urn:xmpp:dataforms:softwareinfo'.
-
-
Method Detail
-
getIcon
public final Media getIcon()
A default icon to show for a device running the software.- Returns:
- The default icon.
-
getOs
public final String getOs()
Description copied from interface:SoftwareInfo
The operating system on which the XMPP software is running.- Specified by:
getOs
in interfaceSoftwareInfo
- Returns:
- The operating system.
-
getOsVersion
public final String getOsVersion()
Gets the operating system version.- Returns:
- The operating system version.
-
getSoftware
public final String getSoftware()
Description copied from interface:SoftwareInfo
Gets the XMPP software running at the entity.- Specified by:
getSoftware
in interfaceSoftwareInfo
- Returns:
- The XMPP software running at the entity.
-
getSoftwareVersion
public final String getSoftwareVersion()
Gets the XMPP software version.- Specified by:
getSoftwareVersion
in interfaceSoftwareInfo
- Returns:
- The XMPP software version.
-
getFormType
public final String getFormType()
Description copied from interface:StandardizedDataForm
Gets the form type of the data form.- Specified by:
getFormType
in interfaceStandardizedDataForm
- Returns:
- The form type.
-
getDataForm
public final DataForm getDataForm()
Gets the underlying data form.- Specified by:
getDataForm
in interfaceStandardizedDataForm
- Returns:
- The underlying data form.
-
-