org.cybergarage.upnp

## Class ControlPoint

- java.lang.Object
- - org.cybergarage.upnp.ControlPoint

- All Implemented Interfaces:
    HTTPRequestListener
  Direct Known Subclasses:
    UPnP

      public class ControlPoint
      extends Object
      implements HTTPRequestListener

  Main UPnP control point implementation for device discovery and control.

  This class implements HTTPRequestListener to provide comprehensive UPnP control point functionality including device discovery, service enumeration, action invocation, and event subscription management. It serves as the primary interface for UPnP control applications.

  Key features:

  - SSDP device discovery and advertisement monitoring
  - HTTP server for receiving control requests
  - Device and service lifecycle management
  - Event subscription and notification handling
  - SOAP action invocation and response processing
  - Multi-homed network interface support
  - Expired device cleanup and monitoring

  This class is used by UPnP control applications to discover, control, and monitor UPnP devices on the network, providing a complete framework for building UPnP control point functionality.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `(package private) ListenerList` | `deviceChangeListenerList`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ControlPoint()`
    `ControlPoint(int ssdpPort, int httpPort)`
    `ControlPoint(int ssdpPort, int httpPort, InetAddress[] binds)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addDeviceChangeListener(DeviceChangeListener listener)`
    `void` | `addEventListener(EventListener listener)`
    `void` | `addNotifyListener(NotifyListener listener)`
    `void` | `addSearchResponseListener(SearchResponseListener listener)`
    `void` | `finalize()`
    `Device` | `getDevice(String name)`
    `Disposer` | `getDeviceDisposer()`
    `DeviceList` | `getDeviceList()`
    `String` | `getEventSubURI()`
    `long` | `getExpiredDeviceMonitoringInterval()`
    `int` | `getHTTPPort()`
    `protected HTTPServerList` | `getHTTPServerList()` I2P was private
    `RenewSubscriber` | `getRenewSubscriber()`
    `int` | `getSearchMx()`
    `protected SSDPNotifySocketList` | `getSSDPNotifySocketList()` I2P was private
    `int` | `getSSDPPort()`
    `protected SSDPSearchResponseSocketList` | `getSSDPSearchResponseSocketList()` I2P was private
    `Service` | `getSubscriberService(String uuid)`
    `Object` | `getUserData()`
    `boolean` | `hasDevice(String name)`
    `void` | `httpRequestRecieved(HTTPRequest httpReq)` Called when an HTTP request is received.
    `boolean` | `isNMPRMode()`
    `boolean` | `isSubscribed(Service service)`
    `void` | `lock()`
    `void` | `notifyReceived(SSDPPacket packet)`
    `void` | `performAddDeviceListener(Device dev)`
    `void` | `performEventListener(String uuid, long seq, String name, String value)`
    `void` | `performNotifyListener(SSDPPacket ssdpPacket)`
    `void` | `performRemoveDeviceListener(Device dev)`
    `void` | `performSearchResponseListener(SSDPPacket ssdpPacket)`
    `void` | `print()`
    `protected void` | `removeDevice(Device dev)`
    `protected void` | `removeDevice(String name)`
    `void` | `removeDeviceChangeListener(DeviceChangeListener listener)`
    `void` | `removeEventListener(EventListener listener)`
    `void` | `removeExpiredDevices()`
    `void` | `removeNotifyListener(NotifyListener listener)`
    `void` | `removeSearchResponseListener(SearchResponseListener listener)`
    `void` | `renewSubscriberService()`
    `void` | `renewSubscriberService(Device dev, long timeout)`
    `void` | `renewSubscriberService(long timeout)`
    `void` | `search()`
    `void` | `search(String target)`
    `void` | `search(String target, int mx)`
    `void` | `searchResponseReceived(SSDPPacket packet)`
    `void` | `setDeviceDisposer(Disposer disposer)`
    `void` | `setEventSubURI(String url)`
    `void` | `setExpiredDeviceMonitoringInterval(long interval)`
    `void` | `setHTTPPort(int port)`
    `void` | `setNMPRMode(boolean flag)`
    `void` | `setRenewSubscriber(RenewSubscriber sub)`
    `void` | `setSearchMx(int mx)`
    `void` | `setSSDPPort(int port)`
    `void` | `setUserData(Object data)`
    `boolean` | `start()`
    `boolean` | `start(String target)`
    `boolean` | `start(String target, int mx)`
    `boolean` | `stop()`
    `boolean` | `subscribe(Service service)`
    `boolean` | `subscribe(Service service, long timeout)`
    `boolean` | `subscribe(Service service, String uuid)`
    `boolean` | `subscribe(Service service, String uuid, long timeout)`
    `void` | `unlock()`
    `void` | `unsubscribe()`
    `void` | `unsubscribe(Device device)`
    `boolean` | `unsubscribe(Service service)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### deviceChangeListenerList

          ListenerList deviceChangeListenerList

  - ### Constructor Detail

    - #### ControlPoint

          public ControlPoint()

    - #### ControlPoint

          public ControlPoint(int ssdpPort,
                              int httpPort)

    - #### ControlPoint

          public ControlPoint(int ssdpPort,
                              int httpPort,
                              InetAddress[] binds)

  - ### Method Detail

    - #### addDeviceChangeListener

          public void addDeviceChangeListener(DeviceChangeListener listener)

    - #### addEventListener

          public void addEventListener(EventListener listener)

    - #### addNotifyListener

          public void addNotifyListener(NotifyListener listener)

    - #### addSearchResponseListener

          public void addSearchResponseListener(SearchResponseListener listener)

    - #### finalize

          public void finalize()

      Overrides:
        `finalize` in class `Object`

    - #### getDevice

          public Device getDevice(String name)

    - #### getDeviceDisposer

          public Disposer getDeviceDisposer()

    - #### getDeviceList

          public DeviceList getDeviceList()

    - #### getEventSubURI

          public String getEventSubURI()

    - #### getExpiredDeviceMonitoringInterval

          public long getExpiredDeviceMonitoringInterval()

    - #### getHTTPPort

          public int getHTTPPort()

    - #### getHTTPServerList

          protected HTTPServerList getHTTPServerList()

      I2P was private

    - #### getRenewSubscriber

          public RenewSubscriber getRenewSubscriber()

    - #### getSearchMx

          public int getSearchMx()

    - #### getSSDPNotifySocketList

          protected SSDPNotifySocketList getSSDPNotifySocketList()

      I2P was private

    - #### getSSDPPort

          public int getSSDPPort()

    - #### getSSDPSearchResponseSocketList

          protected SSDPSearchResponseSocketList getSSDPSearchResponseSocketList()

      I2P was private

    - #### getSubscriberService

          public Service getSubscriberService(String uuid)

    - #### getUserData

          public Object getUserData()

    - #### hasDevice

          public boolean hasDevice(String name)

    - #### httpRequestRecieved

          public void httpRequestRecieved(HTTPRequest httpReq)

      Description copied from interface: `HTTPRequestListener`
      Called when an HTTP request is received.
      Specified by:
        `httpRequestRecieved` in interface `HTTPRequestListener`
      Parameters:
        `httpReq` - the received HTTP request

    - #### isNMPRMode

          public boolean isNMPRMode()

    - #### isSubscribed

          public boolean isSubscribed(Service service)

    - #### lock

          public void lock()

    - #### notifyReceived

          public void notifyReceived(SSDPPacket packet)

    - #### performAddDeviceListener

          public void performAddDeviceListener(Device dev)

    - #### performEventListener

          public void performEventListener(String uuid,
                                           long seq,
                                           String name,
                                           String value)

    - #### performNotifyListener

          public void performNotifyListener(SSDPPacket ssdpPacket)

    - #### performRemoveDeviceListener

          public void performRemoveDeviceListener(Device dev)

    - #### performSearchResponseListener

          public void performSearchResponseListener(SSDPPacket ssdpPacket)

    - #### print

          public void print()

    - #### removeDevice

          protected void removeDevice(Device dev)

    - #### removeDevice

          protected void removeDevice(String name)

    - #### removeDeviceChangeListener

          public void removeDeviceChangeListener(DeviceChangeListener listener)

    - #### removeEventListener

          public void removeEventListener(EventListener listener)

    - #### removeExpiredDevices

          public void removeExpiredDevices()

    - #### removeNotifyListener

          public void removeNotifyListener(NotifyListener listener)

    - #### removeSearchResponseListener

          public void removeSearchResponseListener(SearchResponseListener listener)

    - #### renewSubscriberService

          public void renewSubscriberService()

    - #### renewSubscriberService

          public void renewSubscriberService(Device dev,
                                             long timeout)

    - #### renewSubscriberService

          public void renewSubscriberService(long timeout)

    - #### search

          public void search()

    - #### search

          public void search(String target)

    - #### search

          public void search(String target,
                             int mx)

    - #### searchResponseReceived

          public void searchResponseReceived(SSDPPacket packet)

    - #### setDeviceDisposer

          public void setDeviceDisposer(Disposer disposer)

    - #### setEventSubURI

          public void setEventSubURI(String url)

    - #### setExpiredDeviceMonitoringInterval

          public void setExpiredDeviceMonitoringInterval(long interval)

    - #### setHTTPPort

          public void setHTTPPort(int port)

    - #### setNMPRMode

          public void setNMPRMode(boolean flag)

    - #### setRenewSubscriber

          public void setRenewSubscriber(RenewSubscriber sub)

    - #### setSearchMx

          public void setSearchMx(int mx)

    - #### setSSDPPort

          public void setSSDPPort(int port)

    - #### setUserData

          public void setUserData(Object data)

    - #### start

          public boolean start()

    - #### start

          public boolean start(String target)

    - #### start

          public boolean start(String target,
                               int mx)

    - #### stop

          public boolean stop()

    - #### subscribe

          public boolean subscribe(Service service)

    - #### subscribe

          public boolean subscribe(Service service,
                                   long timeout)

    - #### subscribe

          public boolean subscribe(Service service,
                                   String uuid)

    - #### subscribe

          public boolean subscribe(Service service,
                                   String uuid,
                                   long timeout)

    - #### unlock

          public void unlock()

    - #### unsubscribe

          public void unsubscribe()

    - #### unsubscribe

          public void unsubscribe(Device device)

    - #### unsubscribe

          public boolean unsubscribe(Service service)