Package net.sbbi.upnp.devices
Class RootDevice
- java.lang.Object
-
- net.sbbi.upnp.devices.Device
-
- net.sbbi.upnp.devices.RootDevice
-
public class RootDevice extends Device
Root UPNP device that is contained in a device definition file. Slightly differs from a simple UPNPDevice object. This object will contains all the child devices, this is the top objet in the UPNP device devices hierarchy.
-
-
Field Summary
Fields Modifier and Type Field Description java.net.URL
deviceDefLoc
java.lang.String
discoveryUDN
java.lang.String
discoveryUSN
int
specVersionMajor
int
specVersionMinor
java.lang.String
vendorFirmware
-
Fields inherited from class net.sbbi.upnp.devices.Device
childDevices, deviceType, friendlyName, manufacturer, manufacturerURL, modelDescription, modelName, modelNumber, modelURL, parent, presentationURL, serialNumber, services, UDN, UPC, USN
-
-
Constructor Summary
Constructors Constructor Description RootDevice(org.w3c.dom.Document doc, java.net.URL urlBase, java.lang.String maxAge, java.net.URL deviceDefinition, java.lang.String vendorFirmware, java.lang.String discoveryUSN, java.lang.String discoveryUDN)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static RootDevice
build(java.net.URL deviceDef, java.lang.String maxAge, java.lang.String vendorFirmware, java.lang.String discoveryUSN, java.lang.String discoveryUDN)
java.lang.String
getDeviceDefinitionXML()
Retrieves the device definition XML datalong
getValidityTime()
The validity time for this device in milliseconds,static void
main(java.lang.String[] args)
void
resetValidityTime(java.lang.String newMaxAge)
Resets the device validity time-
Methods inherited from class net.sbbi.upnp.devices.Device
getChildDevice, getChildDevices, getDirectParent, getService, getServiceByID, getServices, getURL, toString
-
-
-
-
Field Detail
-
specVersionMajor
public final int specVersionMajor
-
specVersionMinor
public final int specVersionMinor
-
deviceDefLoc
public final java.net.URL deviceDefLoc
-
vendorFirmware
public final java.lang.String vendorFirmware
-
discoveryUSN
public final java.lang.String discoveryUSN
-
discoveryUDN
public final java.lang.String discoveryUDN
-
-
Constructor Detail
-
RootDevice
public RootDevice(org.w3c.dom.Document doc, java.net.URL urlBase, java.lang.String maxAge, java.net.URL deviceDefinition, java.lang.String vendorFirmware, java.lang.String discoveryUSN, java.lang.String discoveryUDN) throws java.lang.IllegalStateException, javax.xml.xpath.XPathExpressionException
- Parameters:
doc
-urlBase
-maxAge
-deviceDefinition
-vendorFirmware
-discoveryUSN
-discoveryUDN
-- Throws:
java.lang.IllegalStateException
javax.xml.xpath.XPathExpressionException
-
-
Method Detail
-
main
public static void main(java.lang.String[] args) throws java.net.MalformedURLException
- Parameters:
args
-- Throws:
java.net.MalformedURLException
-
build
public static RootDevice build(java.net.URL deviceDef, java.lang.String maxAge, java.lang.String vendorFirmware, java.lang.String discoveryUSN, java.lang.String discoveryUDN)
- Parameters:
deviceDef
-maxAge
-vendorFirmware
-discoveryUSN
-discoveryUDN
-- Returns:
- a new
RootDevice
, ornull
-
getValidityTime
public long getValidityTime()
The validity time for this device in milliseconds,- Returns:
- the number of milliseconds remaining before the device object that has been build is considered to be outdated, after this delay the UPNP device should resend an advertisement message or a negative value if the device is outdated
-
resetValidityTime
public void resetValidityTime(java.lang.String newMaxAge)
Resets the device validity time- Parameters:
newMaxAge
- the maximum age in secs of this UPNP device before considered to be outdated
-
getDeviceDefinitionXML
public java.lang.String getDeviceDefinitionXML()
Retrieves the device definition XML data- Returns:
- the device definition XML data as a String
-
-