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 SummaryFields Modifier and Type Field Description static StringDEFAULT_DESCRIPTION_URIstatic intDEFAULT_DISCOVERY_WAIT_TIMEstatic intDEFAULT_LEASE_TIMEstatic StringDEFAULT_PRESENTATION_URIstatic intDEFAULT_STARTUP_WAIT_TIMEstatic StringELEM_NAMEstatic intHTTP_DEFAULT_PORTstatic StringUPNP_ROOTDEVICE
 - 
Method Summary
 
- 
- 
- 
Field Detail- 
ELEM_NAMEpublic static final String ELEM_NAME - See Also:
- Constant Field Values
 
 - 
UPNP_ROOTDEVICEpublic static final String UPNP_ROOTDEVICE - See Also:
- Constant Field Values
 
 - 
DEFAULT_STARTUP_WAIT_TIMEpublic static final int DEFAULT_STARTUP_WAIT_TIME - See Also:
- Constant Field Values
 
 - 
DEFAULT_DISCOVERY_WAIT_TIMEpublic static final int DEFAULT_DISCOVERY_WAIT_TIME - See Also:
- Constant Field Values
 
 - 
DEFAULT_LEASE_TIMEpublic static final int DEFAULT_LEASE_TIME - See Also:
- Constant Field Values
 
 - 
HTTP_DEFAULT_PORTpublic static final int HTTP_DEFAULT_PORT - See Also:
- Constant Field Values
 
 - 
DEFAULT_DESCRIPTION_URIpublic static final String DEFAULT_DESCRIPTION_URI - See Also:
- Constant Field Values
 
 - 
DEFAULT_PRESENTATION_URIpublic static final String DEFAULT_PRESENTATION_URI - See Also:
- Constant Field Values
 
 
- 
 - 
Constructor Detail- 
Devicepublic Device() 
 - 
Devicepublic Device(Node device) 
 - 
Devicepublic Device(File descriptionFile) throws InvalidDescriptionException - Throws:
- InvalidDescriptionException
 
 - 
Devicepublic Device(InputStream input) throws InvalidDescriptionException - Throws:
- InvalidDescriptionException
- Since:
- 1.8.0
 
 - 
Devicepublic Device(String descriptionFileName) throws InvalidDescriptionException - Throws:
- InvalidDescriptionException
 
 
- 
 - 
Method Detail- 
getRootNodepublic Node getRootNode() 
 - 
getDeviceNodepublic Node getDeviceNode() 
 - 
setRootNodepublic void setRootNode(Node node) 
 - 
setDeviceNodepublic void setDeviceNode(Node node) 
 - 
lockpublic void lock() 
 - 
unlockpublic void unlock() 
 - 
getAbsoluteURLpublic String getAbsoluteURL(String urlString, String baseURLStr, String locationURLStr) 
 - 
setNMPRModepublic void setNMPRMode(boolean flag) 
 - 
isNMPRModepublic boolean isNMPRMode() 
 - 
setWirelessModepublic void setWirelessMode(boolean flag) 
 - 
isWirelessModepublic boolean isWirelessMode() 
 - 
getSSDPAnnounceCountpublic int getSSDPAnnounceCount() 
 - 
getUUIDpublic String getUUID() 
 - 
getBootIdpublic int getBootId() 
 - 
updateConfigIdpublic void updateConfigId() 
 - 
getConfigIdpublic int getConfigId() 
 - 
getRootDevicepublic Device getRootDevice() 
 - 
getParentDevicepublic Device getParentDevice() - Returns:
- A Device that contain this object.
 Returnnullif this is a root device.
 
 - 
addServicepublic void addService(Service s) Add a Service to device without checking for duplicate or syntax error- Parameters:
- s- Add Service s to the Device
 
 - 
addDevicepublic void addDevice(Device d) 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
 
 - 
getDescriptionFilepublic File getDescriptionFile() 
 - 
getDescriptionFilePathpublic String getDescriptionFilePath() 
 - 
loadDescriptionpublic boolean loadDescription(InputStream input) throws InvalidDescriptionException - Throws:
- InvalidDescriptionException
- Since:
- 1.8.0
 
 - 
loadDescriptionpublic boolean loadDescription(String descString) throws InvalidDescriptionException - Throws:
- InvalidDescriptionException
 
 - 
loadDescriptionpublic boolean loadDescription(File file) throws InvalidDescriptionException - Throws:
- InvalidDescriptionException
 
 - 
isDeviceNodepublic static boolean isDeviceNode(Node node) 
 - 
isRootDevicepublic boolean isRootDevice() 
 - 
setSSDPPacketpublic void setSSDPPacket(SSDPPacket packet) 
 - 
getSSDPPacketpublic SSDPPacket getSSDPPacket() 
 - 
getSSDPPacketpublic SSDPPacket getSSDPPacket(boolean preferIPv6) I2P for multiple location support- Since:
- 0.9.50
 
 - 
setLocationpublic void setLocation(String value) 
 - 
getLocationpublic String getLocation() 
 - 
getLocationpublic String getLocation(boolean preferIPv6) I2P for multiple location support- Since:
- 0.9.50
 
 - 
setLeaseTimepublic void setLeaseTime(int value) 
 - 
getLeaseTimepublic int getLeaseTime() 
 - 
getTimeStamppublic long getTimeStamp() 
 - 
getElapsedTimepublic long getElapsedTime() 
 - 
isExpiredpublic boolean isExpired() 
 - 
getURLBasepublic String getURLBase() 
 - 
setDeviceTypepublic void setDeviceType(String value) 
 - 
getDeviceTypepublic String getDeviceType() 
 - 
isDeviceTypepublic boolean isDeviceType(String value) 
 - 
setFriendlyNamepublic void setFriendlyName(String value) 
 - 
getFriendlyNamepublic String getFriendlyName() 
 - 
setManufacturepublic void setManufacture(String value) 
 - 
getManufacturepublic String getManufacture() 
 - 
setManufactureURLpublic void setManufactureURL(String value) 
 - 
getManufactureURLpublic String getManufactureURL() 
 - 
setModelDescriptionpublic void setModelDescription(String value) 
 - 
getModelDescriptionpublic String getModelDescription() 
 - 
setModelNamepublic void setModelName(String value) 
 - 
getModelNamepublic String getModelName() 
 - 
setModelNumberpublic void setModelNumber(String value) 
 - 
getModelNumberpublic String getModelNumber() 
 - 
setModelURLpublic void setModelURL(String value) 
 - 
getModelURLpublic String getModelURL() 
 - 
setSerialNumberpublic void setSerialNumber(String value) 
 - 
getSerialNumberpublic String getSerialNumber() 
 - 
setUDNpublic void setUDN(String value) 
 - 
getUDNpublic String getUDN() 
 - 
hasUDNpublic boolean hasUDN() 
 - 
setUPCpublic void setUPC(String value) 
 - 
getUPCpublic String getUPC() 
 - 
setPresentationURLpublic void setPresentationURL(String value) 
 - 
getPresentationURLpublic String getPresentationURL() 
 - 
removePresentationURLpublic boolean removePresentationURL() 
 - 
setPresentationListenerpublic void setPresentationListener(PresentationListener listener) 
 - 
hasPresentationListenerpublic boolean hasPresentationListener() 
 - 
getPresentationListenerpublic PresentationListener getPresentationListener() 
 - 
getDeviceListpublic DeviceList getDeviceList() 
 - 
isDevicepublic boolean isDevice(String name) 
 - 
getServiceListpublic ServiceList getServiceList() 
 - 
getStateVariablepublic StateVariable getStateVariable(String serviceType, String name) 
 - 
getStateVariablepublic StateVariable getStateVariable(String name) 
 - 
isIconBytesURIpublic boolean isIconBytesURI(String uri) 
 - 
addIconpublic boolean addIcon(Icon icon) 
 - 
getIconListpublic IconList getIconList() 
 - 
getIconpublic Icon getIcon(int n) 
 - 
getSmallestIconpublic Icon getSmallestIcon() 
 - 
notifyWaitpublic static final void notifyWait() 
 - 
announcepublic void announce(String bindAddr) 
 - 
announcepublic void announce() 
 - 
byebyepublic void byebye(String bindAddr) 
 - 
byebyepublic void byebye() 
 - 
postSearchResponsepublic boolean postSearchResponse(SSDPPacket ssdpPacket, String st, String usn) 
 - 
deviceSearchResponsepublic void deviceSearchResponse(SSDPPacket ssdpPacket) 
 - 
deviceSearchReceivedpublic void deviceSearchReceived(SSDPPacket ssdpPacket) - Specified by:
- deviceSearchReceivedin interface- SearchListener
 
 - 
setHTTPPortpublic void setHTTPPort(int port) 
 - 
getHTTPPortpublic int getHTTPPort() 
 - 
setHTTPBindAddresspublic void setHTTPBindAddress(InetAddress[] inets) 
 - 
getHTTPBindAddresspublic InetAddress[] getHTTPBindAddress() 
 - 
getSSDPIPv4MulticastAddresspublic String getSSDPIPv4MulticastAddress() - Returns:
- SSDPIPv4MulticastAddress
- Since:
- 1.8
 
 - 
getSSDPIPv4MulticastAddresspublic void getSSDPIPv4MulticastAddress(String ip) - Parameters:
- ip-
- Since:
- 1.8
 
 - 
getSSDPIPv6MulticastAddresspublic String getSSDPIPv6MulticastAddress() - Returns:
- SSDPIPv6MulticastAddress
- Since:
- 1.8
 
 - 
getSSDPIPv6MulticastAddresspublic void getSSDPIPv6MulticastAddress(String ip) - Parameters:
- ip-
- Since:
- 1.8
 
 - 
httpRequestRecievedpublic void httpRequestRecieved(HTTPRequest httpReq) - Specified by:
- httpRequestRecievedin interface- HTTPRequestListener
 
 - 
setSSDPPortpublic void setSSDPPort(int port) - Parameters:
- port- The port to use for binding the SSDP service
 
 - 
getSSDPPortpublic int getSSDPPort() - Returns:
- The port to use for binding the SSDP service
 
 - 
setSSDPBindAddresspublic void setSSDPBindAddress(InetAddress[] inets) - Parameters:
- inets- The IP that will be used for binding the SSDP service. Use- nullto get the default beahvior
 
 - 
getSSDPBindAddresspublic InetAddress[] getSSDPBindAddress() - Returns:
- inets The IP that will be used for binding the SSDP service. null means the default setted by the class UPnP
 
 - 
setMulticastIPv4Addresspublic void setMulticastIPv4Address(String ip) - Parameters:
- ip- The IPv4 address used for Multicast comunication
 
 - 
getMulticastIPv4Addresspublic String getMulticastIPv4Address() - Returns:
- The IPv4 address used for Multicast comunication
 
 - 
setMulticastIPv6Addresspublic void setMulticastIPv6Address(String ip) - Parameters:
- ip- The IPv address used for Multicast comunication
 
 - 
getMulticastIPv6Addresspublic String getMulticastIPv6Address() - Returns:
- The IPv address used for Multicast comunication
 
 - 
startpublic boolean start() 
 - 
stoppublic boolean stop() 
 - 
isRunningpublic boolean isRunning() 
 - 
getInterfaceAddresspublic String getInterfaceAddress() 
 - 
setActionListenerpublic void setActionListener(ActionListener listener) 
 - 
setQueryListenerpublic void setQueryListener(QueryListener listener) 
 - 
setActionListenerpublic void setActionListener(ActionListener listener, boolean includeSubDevices) 
 - 
setQueryListenerpublic void setQueryListener(QueryListener listener, boolean includeSubDevices) 
 - 
setUserDatapublic void setUserData(Object data) 
 - 
getUserDatapublic Object getUserData() 
 
- 
 
-