org.cybergarage.upnp
Class Device

java.lang.Object
  extended by org.cybergarage.upnp.Device
All Implemented Interfaces:
HTTPRequestListener, SearchListener

public class Device
extends java.lang.Object
implements HTTPRequestListener, SearchListener


Field Summary
static java.lang.String DEFAULT_DESCRIPTION_URI
           
static int DEFAULT_DISCOVERY_WAIT_TIME
           
static int DEFAULT_LEASE_TIME
           
static int DEFAULT_STARTUP_WAIT_TIME
           
static java.lang.String ELEM_NAME
           
static int HTTP_DEFAULT_PORT
           
static java.lang.String UPNP_ROOTDEVICE
           
 
Constructor Summary
Device()
           
Device(java.io.File descriptionFile)
           
Device(Node device)
           
Device(Node root, Node device)
           
Device(java.lang.String descriptionFileName)
           
 
Method Summary
 void announce()
           
 void announce(java.lang.String bindAddr)
           
 void byebye()
           
 void byebye(java.lang.String bindAddr)
           
 void deviceSearchReceived(SSDPPacket ssdpPacket)
           
 void deviceSearchResponse(SSDPPacket ssdpPacket)
           
 Action getAction(java.lang.String name)
           
 java.io.File getDescriptionFile()
           
 java.lang.String getDescriptionFilePath()
           
 Device getDevice(java.lang.String name)
           
 Device getDeviceByDescriptionURI(java.lang.String uri)
           
 DeviceList getDeviceList()
           
 Node getDeviceNode()
           
 java.lang.String getDeviceType()
           
 long getElapsedTime()
           
 java.lang.String getFriendlyName()
           
 int getHTTPPort()
           
 Icon getIcon(int n)
           
 IconList getIconList()
           
 java.lang.String getInterfaceAddress()
           
 int getLeaseTime()
           
 java.lang.String getLocation()
           
 java.lang.String getLocationURL(java.lang.String host)
           
 java.lang.String getManufacture()
           
 java.lang.String getManufactureURL()
           
 java.lang.String getModelDescription()
           
 java.lang.String getModelName()
           
 java.lang.String getModelNumber()
           
 java.lang.String getModelURL()
           
 Device getParentDevice()
           
 java.lang.String getPresentationURL()
           
 Device getRootDevice()
           
 Node getRootNode()
           
 java.lang.String getSerialNumber()
           
 Service getService(java.lang.String name)
           
 Service getServiceByControlURL(java.lang.String searchUrl)
           
 Service getServiceByEventSubURL(java.lang.String searchUrl)
           
 Service getServiceBySCPDURL(java.lang.String searchUrl)
           
 ServiceList getServiceList()
           
 int getSSDPAnnounceCount()
           
 SSDPPacket getSSDPPacket()
           
 StateVariable getStateVariable(java.lang.String name)
           
 StateVariable getStateVariable(java.lang.String serviceType, java.lang.String name)
           
 Service getSubscriberService(java.lang.String uuid)
           
 long getTimeStamp()
           
 java.lang.String getUDN()
           
 java.lang.String getUPC()
           
 java.lang.String getURLBase()
           
 boolean hasUDN()
           
 void httpRequestRecieved(HTTPRequest httpReq)
           
 boolean isDevice(java.lang.String name)
           
static boolean isDeviceNode(Node node)
           
 boolean isDeviceType(java.lang.String value)
           
 boolean isExpired()
           
 boolean isNMPRMode()
           
 boolean isRootDevice()
           
 boolean isWirelessMode()
           
 boolean loadDescription(java.io.File file)
           
 boolean loadDescription(java.lang.String descString)
           
 void lock()
           
static void notifyWait()
           
 boolean postSearchResponse(SSDPPacket ssdpPacket, java.lang.String st, java.lang.String usn)
           
 void setActionListener(ActionListener listener)
           
 void setActionListener(ActionListener listener, boolean includeSubDevices)
           
 void setDeviceNode(Node node)
           
 void setDeviceType(java.lang.String value)
           
 void setFriendlyName(java.lang.String value)
           
 void setHTTPPort(int port)
           
 void setLeaseTime(int value)
           
 void setLocation(java.lang.String value)
           
 void setManufacture(java.lang.String value)
           
 void setManufactureURL(java.lang.String value)
           
 void setModelDescription(java.lang.String value)
           
 void setModelName(java.lang.String value)
           
 void setModelNumber(java.lang.String value)
           
 void setModelURL(java.lang.String value)
           
 void setNMPRMode(boolean flag)
           
 void setPresentationURL(java.lang.String value)
           
 void setQueryListener(QueryListener listener)
           
 void setQueryListener(QueryListener listener, boolean includeSubDevices)
           
 void setRootNode(Node node)
           
 void setSerialNumber(java.lang.String value)
           
 void setSSDPPacket(SSDPPacket packet)
           
 void setUDN(java.lang.String value)
           
 void setUPC(java.lang.String value)
           
 void setWirelessMode(boolean flag)
           
 boolean start()
           
 boolean stop()
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ELEM_NAME

public static final java.lang.String ELEM_NAME
See Also:
Constant Field Values

UPNP_ROOTDEVICE

public static final java.lang.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 java.lang.String DEFAULT_DESCRIPTION_URI
See Also:
Constant Field Values
Constructor Detail

Device

public Device(Node root,
              Node device)

Device

public Device()

Device

public Device(Node device)

Device

public Device(java.io.File descriptionFile)
       throws InvalidDescriptionException
Throws:
InvalidDescriptionException

Device

public Device(java.lang.String descriptionFileName)
       throws InvalidDescriptionException
Throws:
InvalidDescriptionException
Method Detail

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()

getDescriptionFile

public java.io.File getDescriptionFile()

getDescriptionFilePath

public java.lang.String getDescriptionFilePath()

loadDescription

public boolean loadDescription(java.lang.String descString)
                        throws InvalidDescriptionException
Throws:
InvalidDescriptionException

loadDescription

public boolean loadDescription(java.io.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(java.lang.String value)

getLocation

public java.lang.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 java.lang.String getURLBase()

setDeviceType

public void setDeviceType(java.lang.String value)

getDeviceType

public java.lang.String getDeviceType()

isDeviceType

public boolean isDeviceType(java.lang.String value)

setFriendlyName

public void setFriendlyName(java.lang.String value)

getFriendlyName

public java.lang.String getFriendlyName()

setManufacture

public void setManufacture(java.lang.String value)

getManufacture

public java.lang.String getManufacture()

setManufactureURL

public void setManufactureURL(java.lang.String value)

getManufactureURL

public java.lang.String getManufactureURL()

setModelDescription

public void setModelDescription(java.lang.String value)

getModelDescription

public java.lang.String getModelDescription()

setModelName

public void setModelName(java.lang.String value)

getModelName

public java.lang.String getModelName()

setModelNumber

public void setModelNumber(java.lang.String value)

getModelNumber

public java.lang.String getModelNumber()

setModelURL

public void setModelURL(java.lang.String value)

getModelURL

public java.lang.String getModelURL()

setSerialNumber

public void setSerialNumber(java.lang.String value)

getSerialNumber

public java.lang.String getSerialNumber()

setUDN

public void setUDN(java.lang.String value)

getUDN

public java.lang.String getUDN()

hasUDN

public boolean hasUDN()

setUPC

public void setUPC(java.lang.String value)

getUPC

public java.lang.String getUPC()

setPresentationURL

public void setPresentationURL(java.lang.String value)

getPresentationURL

public java.lang.String getPresentationURL()

getDeviceList

public DeviceList getDeviceList()

isDevice

public boolean isDevice(java.lang.String name)

getDevice

public Device getDevice(java.lang.String name)

getDeviceByDescriptionURI

public Device getDeviceByDescriptionURI(java.lang.String uri)

getServiceList

public ServiceList getServiceList()

getService

public Service getService(java.lang.String name)

getServiceBySCPDURL

public Service getServiceBySCPDURL(java.lang.String searchUrl)

getServiceByControlURL

public Service getServiceByControlURL(java.lang.String searchUrl)

getServiceByEventSubURL

public Service getServiceByEventSubURL(java.lang.String searchUrl)

getSubscriberService

public Service getSubscriberService(java.lang.String uuid)

getStateVariable

public StateVariable getStateVariable(java.lang.String serviceType,
                                      java.lang.String name)

getStateVariable

public StateVariable getStateVariable(java.lang.String name)

getAction

public Action getAction(java.lang.String name)

getIconList

public IconList getIconList()

getIcon

public Icon getIcon(int n)

getLocationURL

public java.lang.String getLocationURL(java.lang.String host)

notifyWait

public static final void notifyWait()

announce

public void announce(java.lang.String bindAddr)

announce

public void announce()

byebye

public void byebye(java.lang.String bindAddr)

byebye

public void byebye()

postSearchResponse

public boolean postSearchResponse(SSDPPacket ssdpPacket,
                                  java.lang.String st,
                                  java.lang.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()

httpRequestRecieved

public void httpRequestRecieved(HTTPRequest httpReq)
Specified by:
httpRequestRecieved in interface HTTPRequestListener

start

public boolean start()

stop

public boolean stop()

getInterfaceAddress

public java.lang.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)