Package brisa :: Package upnp :: Package control_point :: Module event :: Class EventListener
[hide private]
[frames] | no frames]

Class EventListener

source code

               object --+        
                        |        
  core.webserver.Resource --+    
                            |    
core.webserver.CustomResource --+
                                |
                               EventListener

EventListener resource available at the control point web server, listening for events.

Instance Methods [hide private]
 
__init__(self, observer)
Constructor for the EventListener class
source code
 
cleanup(self)
Removes reference to observer to make GC easier
source code
 
render(self, uri, request, response)
Event renderer method.
source code
 
render_NOTIFY(self, request, response)
Renders the notify message for an event.
source code
 
forward_notification(self, received_headers, data)
Forwards notifications to the observer registered.
source code
Service or None
_find_service(self, device, subscription_id)
Method to find a service with a specific subscription id on the given device or on it children devices.
source code

Inherited from core.webserver.Resource: add_resource, add_static_file, application, get_render

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, observer)
(Constructor)

source code 

Constructor for the EventListener class

Parameters:
  • observer - observer class with a _on_event() method.
Overrides: object.__init__

render(self, uri, request, response)

source code 

Event renderer method. As events come only on NOTIFY messages, this method ignores any other type of message (GET, POST, ...).

Parameters:
  • uri (string) - URI of the request
  • request - request object (Cherrypy)
  • response - response object (Cherrypy)
Overrides: core.webserver.Resource.render

Note: see Cherrypy documentation for further info about request and response attributes and methods.

render_NOTIFY(self, request, response)

source code 

Renders the notify message for an event.

Parameters:
  • request - request object (Cherrypy)
  • response - response object (Cherrypy)

Note: see Cherrypy documentation for further info about request and response attributes and methods.

forward_notification(self, received_headers, data)

source code 

Forwards notifications to the observer registered.

Parameters:
  • received_headers (dictionary) - headers received on the event notify
  • data (string) - XML data for the event

_find_service(self, device, subscription_id)

source code 

Method to find a service with a specific subscription id on the given device or on it children devices.

Parameters:
  • device (RootDevice or Device) - instance of a device
  • subscription_id (str) - the id to compare with the service
Returns: Service or None
if found, the service