Class DeviceDescription


  • public class DeviceDescription
    extends java.lang.Object
    Class to represent an UPnP device description.
    • Constructor Detail

      • DeviceDescription

        public DeviceDescription​(java.lang.String descriptionUrl)
                          throws java.io.IOException,
                                 java.net.MalformedURLException,
                                 javax.xml.parsers.ParserConfigurationException,
                                 org.xml.sax.SAXException
        Fetches the device description from the provided URL. The constructor also parses the fetched XML and populates internal fields with device and service details.
        Parameters:
        descriptionUrl - URL containing the device description XML
        Throws:
        java.io.IOException
        java.net.MalformedURLException
        javax.xml.parsers.ParserConfigurationException
        org.xml.sax.SAXException
    • Method Detail

      • getDeviceType

        public java.lang.String getDeviceType()
        Get the UPnP device type.
        Returns:
        the UPnP device type
      • getFriendlyName

        public java.lang.String getFriendlyName()
        Get the UPnP device's friendly name.
        Returns:
        the UPnP device's friendly name
      • getManufacturer

        public java.lang.String getManufacturer()
        Get the manufacturer's name.
        Returns:
        the manufacturer's name
      • getManufacturerURL

        public java.lang.String getManufacturerURL()
        Get the manufacturer's web site.
        Returns:
        the manufacturer's web site
      • getModelDescription

        public java.lang.String getModelDescription()
        Get the model description.
        Returns:
        the model description
      • getModelName

        public java.lang.String getModelName()
        Get the model name.
        Returns:
        the model name
      • getModelNumber

        public java.lang.String getModelNumber()
        Get the model number.
        Returns:
        the model number
      • getModelURL

        public java.lang.String getModelURL()
        Get the web site for model.
        Returns:
        the web site for model
      • getSerialNumber

        public java.lang.String getSerialNumber()
        Get the device's serial number.
        Returns:
        the device's serial number
      • getUdn

        public java.lang.String getUdn()
        Get the Unique Device Name (UDN).
        Returns:
        the Unique Device Name
      • getPresentationURL

        public java.lang.String getPresentationURL()
        Get the presentation URL for the device.
        Returns:
        the presentation URL for the device
      • getServices

        public java.util.List<Service> getServices()
        Get the list of all UPnP services of this device.
        Returns:
        a list of UPnP services
      • getServiceByType

        public Service getServiceByType​(java.lang.String type)
        Find a service by UPnP service type.
        Parameters:
        type - the UPnP service type
        Returns:
        the found service or null
      • getServiceById

        public Service getServiceById​(java.lang.String id)
        Find a service by UPnP service identifier.
        Parameters:
        id - the UPnP service identifier
        Returns:
        the found service or null
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object