Package org.cybergarage.upnp
Class Device
java.lang.Object
org.cybergarage.upnp.Device
- All Implemented Interfaces:
HTTPRequestListener
,SearchListener
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a Device to device without checking for duplicate or syntax error.boolean
void
Add a Service to device without checking for duplicate or syntax errorvoid
announce()
void
void
byebye()
void
void
deviceSearchReceived
(SSDPPacket ssdpPacket) void
deviceSearchResponse
(SSDPPacket ssdpPacket) getAbsoluteURL
(String urlString) getAbsoluteURL
(String urlString, String baseURLStr, String locationURLStr) int
int
long
int
getIcon
(int n) getIconByURI
(String uri) int
getLocation
(boolean preferIPv6) I2P for multiple location supportgetLocationURL
(String host) getService
(String name) getServiceByControlURL
(String searchUrl) getServiceByEventSubURL
(String searchUrl) getServiceBySCPDURL
(String searchUrl) int
void
void
getSSDPPacket
(boolean preferIPv6) I2P for multiple location supportint
getStateVariable
(String name) getStateVariable
(String serviceType, String name) getSubscriberService
(String uuid) long
getUDN()
getUPC()
getUUID()
boolean
boolean
hasUDN()
void
httpRequestRecieved
(HTTPRequest httpReq) boolean
static boolean
isDeviceNode
(Node node) boolean
isDeviceType
(String value) boolean
boolean
isIconBytesURI
(String uri) boolean
boolean
boolean
boolean
boolean
loadDescription
(File file) boolean
loadDescription
(InputStream input) boolean
loadDescription
(String descString) void
lock()
static final void
boolean
postSearchResponse
(SSDPPacket ssdpPacket, String st, String usn) boolean
void
setActionListener
(ActionListener listener) void
setActionListener
(ActionListener listener, boolean includeSubDevices) void
setDeviceNode
(Node node) void
setDeviceType
(String value) void
setFriendlyName
(String value) void
setHTTPBindAddress
(InetAddress[] inets) void
setHTTPPort
(int port) void
setLeaseTime
(int value) void
setLocation
(String value) void
setManufacture
(String value) void
setManufactureURL
(String value) void
setModelDescription
(String value) void
setModelName
(String value) void
setModelNumber
(String value) void
setModelURL
(String value) void
void
void
setNMPRMode
(boolean flag) void
setPresentationListener
(PresentationListener listener) void
setPresentationURL
(String value) void
setQueryListener
(QueryListener listener) void
setQueryListener
(QueryListener listener, boolean includeSubDevices) void
setRootNode
(Node node) void
setSerialNumber
(String value) void
setSSDPBindAddress
(InetAddress[] inets) void
setSSDPPacket
(SSDPPacket packet) void
setSSDPPort
(int port) void
void
void
setUserData
(Object data) void
setWirelessMode
(boolean flag) boolean
start()
boolean
stop()
void
unlock()
void
-
Field Details
-
ELEM_NAME
- See Also:
-
UPNP_ROOTDEVICE
- See Also:
-
DEFAULT_STARTUP_WAIT_TIME
public static final int DEFAULT_STARTUP_WAIT_TIME- See Also:
-
DEFAULT_DISCOVERY_WAIT_TIME
public static final int DEFAULT_DISCOVERY_WAIT_TIME- See Also:
-
DEFAULT_LEASE_TIME
public static final int DEFAULT_LEASE_TIME- See Also:
-
HTTP_DEFAULT_PORT
public static final int HTTP_DEFAULT_PORT- See Also:
-
DEFAULT_DESCRIPTION_URI
- See Also:
-
DEFAULT_PRESENTATION_URI
- See Also:
-
-
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
-