Package org.cybergarage.upnp
Class Device
java.lang.Object
org.cybergarage.upnp.Device
- All Implemented Interfaces:
HTTPRequestListener,SearchListener
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd a Device to device without checking for duplicate or syntax error.booleanvoidAdd a Service to device without checking for duplicate or syntax errorvoidannounce()voidvoidbyebye()voidvoiddeviceSearchReceived(SSDPPacket ssdpPacket) voiddeviceSearchResponse(SSDPPacket ssdpPacket) getAbsoluteURL(String urlString) getAbsoluteURL(String urlString, String baseURLStr, String locationURLStr) intintlongintgetIcon(int n) getIconByURI(String uri) intgetLocation(boolean preferIPv6) I2P for multiple location supportgetLocationURL(String host) getService(String name) getServiceByControlURL(String searchUrl) getServiceByEventSubURL(String searchUrl) getServiceBySCPDURL(String searchUrl) intvoidvoidgetSSDPPacket(boolean preferIPv6) I2P for multiple location supportintgetStateVariable(String name) getStateVariable(String serviceType, String name) getSubscriberService(String uuid) longgetUDN()getUPC()getUUID()booleanbooleanhasUDN()voidhttpRequestRecieved(HTTPRequest httpReq) booleanstatic booleanisDeviceNode(Node node) booleanisDeviceType(String value) booleanbooleanisIconBytesURI(String uri) booleanbooleanbooleanbooleanbooleanloadDescription(File file) booleanloadDescription(InputStream input) booleanloadDescription(String descString) voidlock()static final voidbooleanpostSearchResponse(SSDPPacket ssdpPacket, String st, String usn) booleanvoidsetActionListener(ActionListener listener) voidsetActionListener(ActionListener listener, boolean includeSubDevices) voidsetDeviceNode(Node node) voidsetDeviceType(String value) voidsetFriendlyName(String value) voidsetHTTPBindAddress(InetAddress[] inets) voidsetHTTPPort(int port) voidsetLeaseTime(int value) voidsetLocation(String value) voidsetManufacture(String value) voidsetManufactureURL(String value) voidsetModelDescription(String value) voidsetModelName(String value) voidsetModelNumber(String value) voidsetModelURL(String value) voidvoidvoidsetNMPRMode(boolean flag) voidsetPresentationListener(PresentationListener listener) voidsetPresentationURL(String value) voidsetQueryListener(QueryListener listener) voidsetQueryListener(QueryListener listener, boolean includeSubDevices) voidsetRootNode(Node node) voidsetSerialNumber(String value) voidsetSSDPBindAddress(InetAddress[] inets) voidsetSSDPPacket(SSDPPacket packet) voidsetSSDPPort(int port) voidvoidvoidsetUserData(Object data) voidsetWirelessMode(boolean flag) booleanstart()booleanstop()voidunlock()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.
Returnnullif 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:
deviceSearchReceivedin 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:
httpRequestRecievedin 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. Usenullto 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
-