Package org.cybergarage.upnp
Class Device
java.lang.Object
org.cybergarage.upnp.Device
- All Implemented Interfaces:
HTTPRequestListener
,SearchListener
public class Device extends Object implements HTTPRequestListener, SearchListener
-
Field Summary
Fields Modifier and Type Field Description static String
DEFAULT_DESCRIPTION_URI
static int
DEFAULT_DISCOVERY_WAIT_TIME
static int
DEFAULT_LEASE_TIME
static String
DEFAULT_PRESENTATION_URI
static int
DEFAULT_STARTUP_WAIT_TIME
static String
ELEM_NAME
static int
HTTP_DEFAULT_PORT
static String
UPNP_ROOTDEVICE
-
Constructor Summary
-
Method Summary
-
Field Details
-
ELEM_NAME
- See Also:
- Constant Field Values
-
UPNP_ROOTDEVICE
- See Also:
- Constant Field Values
-
DEFAULT_STARTUP_WAIT_TIME
public static final int DEFAULT_STARTUP_WAIT_TIME- See Also:
- Constant Field Values
-
DEFAULT_DISCOVERY_WAIT_TIME
public static final int DEFAULT_DISCOVERY_WAIT_TIME- See Also:
- Constant Field Values
-
DEFAULT_LEASE_TIME
public static final int DEFAULT_LEASE_TIME- See Also:
- Constant Field Values
-
HTTP_DEFAULT_PORT
public static final int HTTP_DEFAULT_PORT- See Also:
- Constant Field Values
-
DEFAULT_DESCRIPTION_URI
- See Also:
- Constant Field Values
-
DEFAULT_PRESENTATION_URI
- See Also:
- Constant Field Values
-
-
Constructor Details
-
Device
-
Device
public Device() -
Device
-
Device
- Throws:
InvalidDescriptionException
-
Device
- Throws:
InvalidDescriptionException
- Since:
- 1.8.0
-
Device
- Throws:
InvalidDescriptionException
-
-
Method Details
-
getRootNode
-
getDeviceNode
-
setRootNode
-
setDeviceNode
-
lock
public void lock() -
unlock
public void unlock() -
getAbsoluteURL
-
getAbsoluteURL
-
setNMPRMode
public void setNMPRMode(boolean flag) -
isNMPRMode
public boolean isNMPRMode() -
setWirelessMode
public void setWirelessMode(boolean flag) -
isWirelessMode
public boolean isWirelessMode() -
getSSDPAnnounceCount
public int getSSDPAnnounceCount() -
getUUID
-
getBootId
public int getBootId() -
updateConfigId
public void updateConfigId() -
getConfigId
public int getConfigId() -
getRootDevice
-
getParentDevice
- Returns:
- A Device that contain this object.
Returnnull
if this is a root device.
-
addService
Add a Service to device without checking for duplicate or syntax error- Parameters:
s
- Add Service s to the Device
-
addDevice
Add a Device to device without checking for duplicate or syntax error. This method set or reset the root node of the Device and itself
Note: This method should be used to create a dynamic
Device withtout writing any XML that describe the device- Parameters:
d
- Add Device d to the Device
-
getDescriptionFile
-
getDescriptionFilePath
-
loadDescription
- Throws:
InvalidDescriptionException
- Since:
- 1.8.0
-
loadDescription
- Throws:
InvalidDescriptionException
-
loadDescription
- Throws:
InvalidDescriptionException
-
isDeviceNode
-
isRootDevice
public boolean isRootDevice() -
setSSDPPacket
-
getSSDPPacket
-
getSSDPPacket
I2P for multiple location support- Since:
- 0.9.50
-
setLocation
-
getLocation
-
getLocation
I2P for multiple location support- Since:
- 0.9.50
-
setLeaseTime
public void setLeaseTime(int value) -
getLeaseTime
public int getLeaseTime() -
getTimeStamp
public long getTimeStamp() -
getElapsedTime
public long getElapsedTime() -
isExpired
public boolean isExpired() -
getURLBase
-
setDeviceType
-
getDeviceType
-
isDeviceType
-
setFriendlyName
-
getFriendlyName
-
setManufacture
-
getManufacture
-
setManufactureURL
-
getManufactureURL
-
setModelDescription
-
getModelDescription
-
setModelName
-
getModelName
-
setModelNumber
-
getModelNumber
-
setModelURL
-
getModelURL
-
setSerialNumber
-
getSerialNumber
-
setUDN
-
getUDN
-
hasUDN
public boolean hasUDN() -
setUPC
-
getUPC
-
setPresentationURL
-
getPresentationURL
-
removePresentationURL
public boolean removePresentationURL() -
setPresentationListener
-
hasPresentationListener
public boolean hasPresentationListener() -
getPresentationListener
-
getDeviceList
-
isDevice
-
getDevice
-
getDeviceByDescriptionURI
-
getServiceList
-
getService
-
getServiceBySCPDURL
-
getServiceByControlURL
-
getServiceByEventSubURL
-
getSubscriberService
-
getStateVariable
-
getStateVariable
-
getAction
-
isIconBytesURI
-
getIconByURI
-
addIcon
-
getIconList
-
getIcon
-
getSmallestIcon
-
getLocationURL
-
notifyWait
public static final void notifyWait() -
announce
-
announce
public void announce() -
byebye
-
byebye
public void byebye() -
postSearchResponse
-
deviceSearchResponse
-
deviceSearchReceived
- Specified by:
deviceSearchReceived
in interfaceSearchListener
-
setHTTPPort
public void setHTTPPort(int port) -
getHTTPPort
public int getHTTPPort() -
setHTTPBindAddress
-
getHTTPBindAddress
-
getSSDPIPv4MulticastAddress
- Returns:
- SSDPIPv4MulticastAddress
- Since:
- 1.8
-
getSSDPIPv4MulticastAddress
- Parameters:
ip
-- Since:
- 1.8
-
getSSDPIPv6MulticastAddress
- Returns:
- SSDPIPv6MulticastAddress
- Since:
- 1.8
-
getSSDPIPv6MulticastAddress
- Parameters:
ip
-- Since:
- 1.8
-
httpRequestRecieved
- Specified by:
httpRequestRecieved
in interfaceHTTPRequestListener
-
setSSDPPort
public void setSSDPPort(int port)- Parameters:
port
- The port to use for binding the SSDP service
-
getSSDPPort
public int getSSDPPort()- Returns:
- The port to use for binding the SSDP service
-
setSSDPBindAddress
- Parameters:
inets
- The IP that will be used for binding the SSDP service. Usenull
to get the default beahvior
-
getSSDPBindAddress
- Returns:
- inets The IP that will be used for binding the SSDP service. null means the default setted by the class UPnP
-
setMulticastIPv4Address
- Parameters:
ip
- The IPv4 address used for Multicast comunication
-
getMulticastIPv4Address
- Returns:
- The IPv4 address used for Multicast comunication
-
setMulticastIPv6Address
- Parameters:
ip
- The IPv address used for Multicast comunication
-
getMulticastIPv6Address
- Returns:
- The IPv address used for Multicast comunication
-
start
public boolean start() -
stop
public boolean stop() -
isRunning
public boolean isRunning() -
getInterfaceAddress
-
setActionListener
-
setQueryListener
-
setActionListener
-
setQueryListener
-
setUserData
-
getUserData
-