Package net.sbbi.upnp.devices
Class RootDevice
java.lang.Object
net.sbbi.upnp.devices.Device
net.sbbi.upnp.devices.RootDevice
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
FieldsModifier and TypeFieldDescriptionfinal URL
final String
final String
final int
final int
final String
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 -
Method Summary
Modifier and TypeMethodDescriptionstatic RootDevice
build
(URL deviceDef, String maxAge, String vendorFirmware, String discoveryUSN, String discoveryUDN) Retrieves the device definition XML datalong
The validity time for this device in milliseconds,static void
void
resetValidityTime
(String newMaxAge) Resets the device validity timeMethods inherited from class net.sbbi.upnp.devices.Device
getChildDevice, getChildDevices, getDirectParent, getService, getServiceByID, getServices, getURL, toString
-
Field Details
-
specVersionMajor
public final int specVersionMajor -
specVersionMinor
public final int specVersionMinor -
deviceDefLoc
-
vendorFirmware
-
discoveryUSN
-
discoveryUDN
-
-
Constructor Details
-
RootDevice
public RootDevice(Document doc, URL urlBase, String maxAge, URL deviceDefinition, String vendorFirmware, String discoveryUSN, String discoveryUDN) throws IllegalStateException, XPathExpressionException - Parameters:
doc
-urlBase
-maxAge
-deviceDefinition
-vendorFirmware
-discoveryUSN
-discoveryUDN
-- Throws:
IllegalStateException
XPathExpressionException
-
-
Method Details
-
main
- Parameters:
args
-- Throws:
MalformedURLException
-
build
public static RootDevice build(URL deviceDef, String maxAge, String vendorFirmware, String discoveryUSN, 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
Resets the device validity time- Parameters:
newMaxAge
- the maximum age in secs of this UPNP device before considered to be outdated
-
getDeviceDefinitionXML
Retrieves the device definition XML data- Returns:
- the device definition XML data as a String
-