public class Discovery
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALL_DEVICES |
static int |
DEFAULT_MX |
static java.lang.String |
DEFAULT_SEARCH |
static int |
DEFAULT_SSDP_SEARCH_PORT |
static int |
DEFAULT_TIMEOUT |
static int |
DEFAULT_TTL |
static java.lang.String |
ROOT_DEVICES |
static java.lang.String |
SSDP_IP |
static int |
SSDP_PORT |
Constructor and Description |
---|
Discovery() |
Modifier and Type | Method and Description |
---|---|
static RootDevice[] |
discover()
Devices discovering on all network interfaces with default
values, all root devices will be searched
|
static RootDevice[] |
discover(int timeOut,
int ttl,
int mx,
java.lang.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 RootDevice[] |
discover(int timeOut,
int ttl,
int mx,
java.lang.String searchTarget,
java.net.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 RootDevice[] |
discover(int timeOut,
java.lang.String searchTarget)
Devices discovering on all network interfaces with a given
timeout and a given root device to search
|
static RootDevice[] |
discover(java.lang.String searchTarget)
Devices discovering on all network interfaces with a given root
device to search
|
static void |
sendSearchMessage(java.net.InetAddress src,
int ttl,
int mx,
java.lang.String searchTarget)
Sends an SSDP search message on the network
|
public static final java.lang.String ROOT_DEVICES
public static final java.lang.String ALL_DEVICES
public static final int DEFAULT_MX
public static final int DEFAULT_TTL
public static final int DEFAULT_TIMEOUT
public static final java.lang.String DEFAULT_SEARCH
public static final int DEFAULT_SSDP_SEARCH_PORT
public static final java.lang.String SSDP_IP
public static final int SSDP_PORT
public static RootDevice[] discover() throws java.io.IOException
java.io.IOException
- if some IOException occurs during discoveringpublic static RootDevice[] discover(java.lang.String searchTarget) throws java.io.IOException
searchTarget
- the device URI to searchjava.io.IOException
- if some IOException occurs during discoveringpublic static RootDevice[] discover(int timeOut, java.lang.String searchTarget) throws java.io.IOException
timeOut
- the time allowed for a device to give a responsesearchTarget
- the device URI to searchjava.io.IOException
- if some IOException occurs during discoveringpublic static RootDevice[] discover(int timeOut, int ttl, int mx, java.lang.String searchTarget) throws java.io.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 searchjava.io.IOException
- if some IOException occurs during discoveringpublic static RootDevice[] discover(int timeOut, int ttl, int mx, java.lang.String searchTarget, java.net.NetworkInterface ni) throws java.io.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 interfacesjava.io.IOException
- if some IOException occurs during discoveringpublic static void sendSearchMessage(java.net.InetAddress src, int ttl, int mx, java.lang.String searchTarget) throws java.io.IOException
src
- the sender ipttl
- the time to livemx
- the mx fieldsearchTarget
- the search targetjava.io.IOException
- if some IO errors occurs during search