| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.tomp2p.upnp.Discovery
public class Discovery
Class to discover an UPNP device on the network. A multicast socket will be created to discover devices, the binding port for this socket is set to 1901, if this is causing a problem you can use the net.sbbi.upnp.Discovery.bindPort system property to specify another port. The discovery methods only accept matching device description and broadcast message response IP to avoid a security flaw with the protocol. If you are not happy with such behaviour you can set the net.sbbi.upnp.ddos.matchip system property to false to avoid this check.
| Field Summary | |
|---|---|
static String | 
ALL_DEVICES
 | 
static int | 
DEFAULT_MX
 | 
static String | 
DEFAULT_SEARCH
 | 
static int | 
DEFAULT_SSDP_SEARCH_PORT
 | 
static int | 
DEFAULT_TIMEOUT
 | 
static int | 
DEFAULT_TTL
 | 
static String | 
ROOT_DEVICES
 | 
static String | 
SSDP_IP
 | 
static int | 
SSDP_PORT
 | 
| Constructor Summary | |
|---|---|
Discovery()
 | 
|
| Method Summary | |
|---|---|
static Collection<RootDevice> | 
discover()
Devices discovering on all network interfaces with default values, all root devices will be searched  | 
static Collection<RootDevice> | 
discover(int timeOut,
         int ttl,
         int mx,
         String searchTarget)
Devices discovering on all network interfaces with a given timeout and a given root device to search, as well as a ttl and mx param  | 
static Collection<RootDevice> | 
discover(int timeOut,
         int ttl,
         int mx,
         String searchTarget,
         NetworkInterface ni)
Devices discovering with a given timeout and a given root device to search on an given network interface, as well as a ttl and mx param  | 
static Collection<RootDevice> | 
discover(int timeOut,
         String searchTarget)
Devices discovering on all network interfaces with a given timeout and a given root device to search  | 
static Collection<RootDevice> | 
discover(String searchTarget)
Devices discovering on all network interfaces with a given root device to search  | 
static void | 
sendSearchMessage(InetAddress src,
                  int ttl,
                  int mx,
                  String searchTarget)
Sends an SSDP search message on the network  | 
| Methods inherited from class java.lang.Object | 
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
|---|
public static final String ROOT_DEVICES
public static final String ALL_DEVICES
public static final int DEFAULT_MX
public static final int DEFAULT_TTL
public static final int DEFAULT_TIMEOUT
public static final String DEFAULT_SEARCH
public static final int DEFAULT_SSDP_SEARCH_PORT
public static final String SSDP_IP
public static final int SSDP_PORT
| Constructor Detail | 
|---|
public Discovery()
| Method Detail | 
|---|
public static Collection<RootDevice> discover()
                                       throws IOException
IOException - if some IOException occurs during discovering
public static Collection<RootDevice> discover(String searchTarget)
                                       throws IOException
searchTarget - the device URI to search
IOException - if some IOException occurs during discovering
public static Collection<RootDevice> discover(int timeOut,
                                              String searchTarget)
                                       throws IOException
timeOut - the time allowed for a device to give a responsesearchTarget - the device URI to search
IOException - if some IOException occurs during discovering
public static Collection<RootDevice> discover(int timeOut,
                                              int ttl,
                                              int mx,
                                              String searchTarget)
                                       throws IOException
timeOut - the timeout for the a device to give a reponsettl - the UDP socket packets time to livemx - discovery message mx http header field valuesearchTarget - the device URI to search
IOException - if some IOException occurs during discovering
public static Collection<RootDevice> discover(int timeOut,
                                              int ttl,
                                              int mx,
                                              String searchTarget,
                                              NetworkInterface ni)
                                       throws IOException
timeOut - the timeout for the a device to give a reponsettl - the UDP socket packets time to livemx - discovery message mx http header field valuesearchTarget - the device URI to searchni - the networkInterface where to search devices, null to lookup all interfaces
IOException - if some IOException occurs during discovering
public static void sendSearchMessage(InetAddress src,
                                     int ttl,
                                     int mx,
                                     String searchTarget)
                              throws IOException
src - the sender ipttl - the time to livemx - the mx fieldsearchTarget - the search target
IOException - if some IO errors occurs during search
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||