net.tomp2p.upnp
Class RootDevice

java.lang.Object
  extended by net.tomp2p.upnp.Device
      extended by net.tomp2p.upnp.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.

Version:
1.0
Author:
SuperBonBon

Field Summary
 
Fields inherited from class net.tomp2p.upnp.Device
childDevices, deviceType, friendlyName, manufacturer, manufacturerURL, modelDescription, modelName, modelNumber, modelURL, parent, presentationURL, serialNumber, services, UDN, UPC, USN
 
Constructor Summary
RootDevice(Document doc, URL urlBase, String maxAge, URL deviceDefinition, String vendorFirmware, String discoveryUSN, String discoveryUDN, InetAddress localIP)
           
 
Method Summary
static RootDevice build(URL deviceDef, String maxAge, String vendorFirmware, String discoveryUSN, String discoveryUDN, InetAddress localIP)
           
 String getDeviceDefinitionXML()
          Retrieves the device definition XML data
 String getDiscoveryUDN()
           
 String getDiscoveryUSN()
           
 InetAddress getLocalIP()
           
 int getSpecVersionMajor()
           
 int getSpecVersionMinor()
           
 long getValidityTime()
          The validity time for this device in milliseconds,
 String getVendorFirmware()
           
 void resetValidityTime(String newMaxAge)
          Resets the device validity time
 
Methods inherited from class net.tomp2p.upnp.Device
getChildDevice, getChildDevices, getDirectParent, getService, getServiceByID, getServices, getURL, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RootDevice

public RootDevice(Document doc,
                  URL urlBase,
                  String maxAge,
                  URL deviceDefinition,
                  String vendorFirmware,
                  String discoveryUSN,
                  String discoveryUDN,
                  InetAddress localIP)
           throws IllegalStateException,
                  XPathExpressionException
Parameters:
doc -
urlBase -
maxAge -
deviceDefinition -
vendorFirmware -
discoveryUSN -
discoveryUDN -
Throws:
IllegalStateException
XPathExpressionException
Method Detail

build

public static RootDevice build(URL deviceDef,
                               String maxAge,
                               String vendorFirmware,
                               String discoveryUSN,
                               String discoveryUDN,
                               InetAddress localIP)
Parameters:
deviceDef -
maxAge -
vendorFirmware -
discoveryUSN -
discoveryUDN -
Returns:
a new RootDevice, or null

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(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 String getDeviceDefinitionXML()
Retrieves the device definition XML data

Returns:
the device definition XML data as a String

getSpecVersionMajor

public int getSpecVersionMajor()

getSpecVersionMinor

public int getSpecVersionMinor()

getVendorFirmware

public String getVendorFirmware()

getDiscoveryUSN

public String getDiscoveryUSN()

getDiscoveryUDN

public String getDiscoveryUDN()

getLocalIP

public InetAddress getLocalIP()


Copyright © 2013. All Rights Reserved.