public class UPnP extends Object
This class provides static methods and constants for configuring the UPnP framework, including network settings, XML parser configuration, and utility functions for UUID generation, server identification, and framework initialization.
The class serves as the main entry point for framework-wide configuration and provides constants used throughout the UPnP implementation.
| Modifier and Type | Field and Description |
|---|---|
static int |
CONFIGID_UPNP_ORG_MAX
Maximum value for UPnP.org configuration IDs.
|
static int |
DEFAULT_EXPIRED_DEVICE_EXTRA_TIME
Default extra time in seconds before considering a device expired.
|
static int |
DEFAULT_TTL
Default time-to-live value for multicast packets.
|
static String |
INMPR03
INMPR03 protocol identifier.
|
static int |
INMPR03_DISCOVERY_OVER_WIRELESS_COUNT
Number of discovery attempts over wireless interfaces for INMPR03.
|
static String |
INMPR03_VERSION
INMPR03 protocol version.
|
static String |
NAME
Framework name used in server identification.
|
static int |
SERVER_RETRY_COUNT
Number of retry attempts for server operations.
|
static int |
USE_IPV6_ADMINISTRATIVE_SCOPE
Enable IPv6 administrative scope addresses.
|
static int |
USE_IPV6_GLOBAL_SCOPE
Enable IPv6 global scope addresses.
|
static int |
USE_IPV6_LINK_LOCAL_SCOPE
Enable IPv6 link-local scope addresses.
|
static int |
USE_IPV6_SITE_LOCAL_SCOPE
Enable IPv6 site-local scope addresses.
|
static int |
USE_IPV6_SUBNET_SCOPE
Enable IPv6 subnet scope addresses.
|
static int |
USE_LOOPBACK_ADDR
Enable loopback address usage.
|
static int |
USE_ONLY_IPV4_ADDR
Enable IPv4-only addressing mode.
|
static int |
USE_ONLY_IPV6_ADDR
Enable IPv6-only addressing mode.
|
static int |
USE_SSDP_SEARCHRESPONSE_MULTIPLE_INTERFACES
Enable SSDP search responses on multiple interfaces.
|
static String |
VERSION
Framework version used in server identification.
|
static String |
XML_CLASS_PROPERTTY
Name of the system properties used to identifies the default XML Parser.
The value of the properties MUST BE the fully qualified class name of XML Parser which CyberLink should use. |
static String |
XML_DECLARATION
Standard XML declaration for UPnP documents.
|
| Constructor and Description |
|---|
UPnP() |
| Modifier and Type | Method and Description |
|---|---|
static int |
caluculateConfigId(String configXml)
Calculates a configuration ID from the given XML configuration.
|
static int |
createBootId()
Creates a boot ID for UPnP device identification.
|
static String |
createUUID()
Creates a unique UUID for UPnP device identification.
|
static String |
getServerName()
Generates the server identification string for UPnP operations.
|
static int |
getTimeToLive()
Gets the current time-to-live value for multicast packets.
|
static Parser |
getXMLParser()
Gets the XML parser used by the UPnP framework.
|
static void |
initialize()
Initializes the UPnP framework.
|
static boolean |
isEnabled(int value)
Checks if a specific UPnP framework feature or configuration option is enabled.
|
static void |
setDisable(int value)
Disables a specific UPnP framework feature or configuration option.
|
static void |
setEnable(int value)
Enables a specific UPnP framework feature or configuration option.
|
static void |
setTimeToLive(int value)
Sets the time-to-live value for multicast packets.
|
static void |
setXMLParser(Parser parser)
Sets the XML parser to be used by the UPnP framework.
|
public static final int CONFIGID_UPNP_ORG_MAX
public static final int DEFAULT_EXPIRED_DEVICE_EXTRA_TIME
public static final int DEFAULT_TTL
public static final String INMPR03
public static final int INMPR03_DISCOVERY_OVER_WIRELESS_COUNT
public static final String INMPR03_VERSION
public static final String NAME
public static final int SERVER_RETRY_COUNT
public static final int USE_IPV6_ADMINISTRATIVE_SCOPE
public static final int USE_IPV6_GLOBAL_SCOPE
public static final int USE_IPV6_LINK_LOCAL_SCOPE
public static final int USE_IPV6_SITE_LOCAL_SCOPE
public static final int USE_IPV6_SUBNET_SCOPE
public static final int USE_LOOPBACK_ADDR
public static final int USE_ONLY_IPV4_ADDR
public static final int USE_ONLY_IPV6_ADDR
public static final int USE_SSDP_SEARCHRESPONSE_MULTIPLE_INTERFACES
public static final String VERSION
public static final String XML_CLASS_PROPERTTY
public static final String XML_DECLARATION
public static final int caluculateConfigId(String configXml)
configXml - the XML configuration stringpublic static final int createBootId()
public static final String createUUID()
public static final String getServerName()
public static final int getTimeToLive()
public static final Parser getXMLParser()
RuntimeException - if no XML parser is availablepublic static final void initialize()
public static final boolean isEnabled(int value)
value - the feature to check (one of the USE_* constants)public static final void setDisable(int value)
value - the feature to disable (one of the USE_* constants)public static final void setEnable(int value)
value - the feature to enable (one of the USE_* constants)public static final void setTimeToLive(int value)
value - the TTL value to setpublic static final void setXMLParser(Parser parser)
parser - the XML parser implementation