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 DataFormgetDataForm()Gets the underlying data form.StringgetFormType()Gets the form type of the data form.MediagetIcon()A default icon to show for a device running the software.StringgetOs()The operating system on which the XMPP software is running.StringgetOsVersion()Gets the operating system version.StringgetSoftware()Gets the XMPP software running at the entity.StringgetSoftwareVersion()Gets the XMPP software version.StringtoString()
-
-
-
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:SoftwareInfoThe operating system on which the XMPP software is running.- Specified by:
getOsin 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:SoftwareInfoGets the XMPP software running at the entity.- Specified by:
getSoftwarein interfaceSoftwareInfo- Returns:
- The XMPP software running at the entity.
-
getSoftwareVersion
public final String getSoftwareVersion()
Gets the XMPP software version.- Specified by:
getSoftwareVersionin interfaceSoftwareInfo- Returns:
- The XMPP software version.
-
getFormType
public final String getFormType()
Description copied from interface:StandardizedDataFormGets the form type of the data form.- Specified by:
getFormTypein interfaceStandardizedDataForm- Returns:
- The form type.
-
getDataForm
public final DataForm getDataForm()
Gets the underlying data form.- Specified by:
getDataFormin interfaceStandardizedDataForm- Returns:
- The underlying data form.
-
-