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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ELEM_NAME
public static final String ELEM_NAME
- See Also:
- Constant Field Values
UPNP_ROOTDEVICE
public static final String 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
public static final String DEFAULT_DESCRIPTION_URI
- See Also:
- Constant Field Values
Device
public Device(Node root,
Node device)
Device
public Device()
Device
public Device(Node device)
Device
public Device(File descriptionFile)
throws InvalidDescriptionException
- Throws:
InvalidDescriptionException
Device
public Device(InputStream input)
throws InvalidDescriptionException
- Throws:
InvalidDescriptionException
- Since:
- 1.8.0
Device
public Device(String descriptionFileName)
throws InvalidDescriptionException
- Throws:
InvalidDescriptionException
getRootNode
public Node getRootNode()
getDeviceNode
public Node getDeviceNode()
setRootNode
public void setRootNode(Node node)
setDeviceNode
public void setDeviceNode(Node node)
lock
public void lock()
unlock
public void unlock()
setNMPRMode
public void setNMPRMode(boolean flag)
isNMPRMode
public boolean isNMPRMode()
setWirelessMode
public void setWirelessMode(boolean flag)
isWirelessMode
public boolean isWirelessMode()
getSSDPAnnounceCount
public int getSSDPAnnounceCount()
getRootDevice
public Device getRootDevice()
getParentDevice
public Device getParentDevice()
- Returns:
- A Device that contain this object.
Return null
if this is a root device.
addService
public void addService(Service s)
- Add a Service to device without checking for duplicate or syntax error
- Parameters:
s
- Add Service s to the Device
addDevice
public 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
getDescriptionFile
public File getDescriptionFile()
getDescriptionFilePath
public String getDescriptionFilePath()
loadDescription
public boolean loadDescription(InputStream input)
throws InvalidDescriptionException
- Throws:
InvalidDescriptionException
- Since:
- 1.8.0
loadDescription
public boolean loadDescription(String descString)
throws InvalidDescriptionException
- Throws:
InvalidDescriptionException
loadDescription
public boolean loadDescription(File file)
throws InvalidDescriptionException
- Throws:
InvalidDescriptionException
isDeviceNode
public static boolean isDeviceNode(Node node)
isRootDevice
public boolean isRootDevice()
setSSDPPacket
public void setSSDPPacket(SSDPPacket packet)
getSSDPPacket
public SSDPPacket getSSDPPacket()
setLocation
public void setLocation(String value)
getLocation
public String getLocation()
setLeaseTime
public void setLeaseTime(int value)
getLeaseTime
public int getLeaseTime()
getTimeStamp
public long getTimeStamp()
getElapsedTime
public long getElapsedTime()
isExpired
public boolean isExpired()
getURLBase
public String getURLBase()
setDeviceType
public void setDeviceType(String value)
getDeviceType
public String getDeviceType()
isDeviceType
public boolean isDeviceType(String value)
setFriendlyName
public void setFriendlyName(String value)
getFriendlyName
public String getFriendlyName()
setManufacture
public void setManufacture(String value)
getManufacture
public String getManufacture()
setManufactureURL
public void setManufactureURL(String value)
getManufactureURL
public String getManufactureURL()
setModelDescription
public void setModelDescription(String value)
getModelDescription
public String getModelDescription()
setModelName
public void setModelName(String value)
getModelName
public String getModelName()
setModelNumber
public void setModelNumber(String value)
getModelNumber
public String getModelNumber()
setModelURL
public void setModelURL(String value)
getModelURL
public String getModelURL()
setSerialNumber
public void setSerialNumber(String value)
getSerialNumber
public String getSerialNumber()
setUDN
public void setUDN(String value)
getUDN
public String getUDN()
hasUDN
public boolean hasUDN()
setUPC
public void setUPC(String value)
getUPC
public String getUPC()
setPresentationURL
public void setPresentationURL(String value)
getPresentationURL
public String getPresentationURL()
getDeviceList
public DeviceList getDeviceList()
isDevice
public boolean isDevice(String name)
getDevice
public Device getDevice(String name)
getDeviceByDescriptionURI
public Device getDeviceByDescriptionURI(String uri)
getServiceList
public ServiceList getServiceList()
getService
public Service getService(String name)
getServiceBySCPDURL
public Service getServiceBySCPDURL(String searchUrl)
getServiceByControlURL
public Service getServiceByControlURL(String searchUrl)
getServiceByEventSubURL
public Service getServiceByEventSubURL(String searchUrl)
getSubscriberService
public Service getSubscriberService(String uuid)
getStateVariable
public StateVariable getStateVariable(String serviceType,
String name)
getStateVariable
public StateVariable getStateVariable(String name)
getAction
public Action getAction(String name)
getIconList
public IconList getIconList()
getIcon
public Icon getIcon(int n)
getLocationURL
public String getLocationURL(String host)
notifyWait
public static final void notifyWait()
announce
public void announce(String bindAddr)
announce
public void announce()
byebye
public void byebye(String bindAddr)
byebye
public void byebye()
postSearchResponse
public boolean postSearchResponse(SSDPPacket ssdpPacket,
String st,
String usn)
deviceSearchResponse
public void deviceSearchResponse(SSDPPacket ssdpPacket)
deviceSearchReceived
public void deviceSearchReceived(SSDPPacket ssdpPacket)
- Specified by:
deviceSearchReceived
in interface SearchListener
setHTTPPort
public void setHTTPPort(int port)
getHTTPPort
public int getHTTPPort()
setHTTPBindAddress
public void setHTTPBindAddress(InetAddress[] inets)
getHTTPBindAddress
public InetAddress[] getHTTPBindAddress()
getSSDPIPv4MulticastAddress
public String getSSDPIPv4MulticastAddress()
- Returns:
- Since:
- 1.8
getSSDPIPv4MulticastAddress
public void getSSDPIPv4MulticastAddress(String ip)
- Parameters:
ip
- - Since:
- 1.8
httpRequestRecieved
public void httpRequestRecieved(HTTPRequest httpReq)
- Specified by:
httpRequestRecieved
in interface HTTPRequestListener
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
public void setSSDPBindAddress(InetAddress[] inets)
- Parameters:
inets
- The IP that will be used for binding the SSDP service.
Use null
to get the default beahvior
getSSDPBindAddress
public InetAddress[] getSSDPBindAddress()
- Returns:
- inets The IP that will be used for binding the SSDP service.
null means the default setted by the class UPnP
setMulticastIPv4Address
public void setMulticastIPv4Address(String ip)
- Parameters:
ip
- The IPv4 address used for Multicast comunication
getMulticastIPv4Address
public String getMulticastIPv4Address()
- Returns:
- The IPv4 address used for Multicast comunication
start
public boolean start()
stop
public boolean stop()
getInterfaceAddress
public String getInterfaceAddress()
setActionListener
public void setActionListener(ActionListener listener)
setQueryListener
public void setQueryListener(QueryListener listener)
setActionListener
public void setActionListener(ActionListener listener,
boolean includeSubDevices)
setQueryListener
public void setQueryListener(QueryListener listener,
boolean includeSubDevices)
setUserData
public void setUserData(Object data)
getUserData
public Object getUserData()
Copyright © 2009 DomoWare. All Rights Reserved.