Class Discovery


  • public class Discovery
    extends java.lang.Object
    This class allows a control point to search for devices of interest on the network. If no search target is specified, the class will look for all UPnP root devices.
    • Constructor Summary

      Constructors 
      Constructor Description
      Discovery()
      Default constructor.
      Discovery​(int timeout)  
      Discovery​(int timeout, java.lang.String... searchTargets)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<Device> discover()
      Sends UPnP discovery packets to the UPnP multicast address and parses the responses.
      boolean isIpv6Enabled()  
      void setIpv6Enabled​(boolean ipv6Enabled)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Discovery

        public Discovery()
        Default constructor. This will return all root devices with a timeout of 3000.
      • Discovery

        public Discovery​(int timeout)
      • Discovery

        public Discovery​(int timeout,
                         java.lang.String... searchTargets)
    • Method Detail

      • isIpv6Enabled

        public boolean isIpv6Enabled()
      • setIpv6Enabled

        public void setIpv6Enabled​(boolean ipv6Enabled)
      • discover

        public java.util.List<Device> discover()
                                        throws java.net.SocketException,
                                               java.net.UnknownHostException,
                                               java.io.IOException,
                                               org.xml.sax.SAXException,
                                               javax.xml.parsers.ParserConfigurationException
        Sends UPnP discovery packets to the UPnP multicast address and parses the responses.
        Returns:
        list of target UPnP devices
        Throws:
        java.net.SocketException
        java.net.UnknownHostException
        java.io.IOException
        org.xml.sax.SAXException
        javax.xml.parsers.ParserConfigurationException