Package ZenEvents :: Module MySqlSendEvent :: Class MySqlSendEventMixin
[show private | hide private]
[frames | no frames]

Class MySqlSendEventMixin

Known Subclasses:
MySqlEventManager, MySqlSendEvent

Mix-in class that takes a mysql db connection and builds inserts that send the event to the backend.
Method Summary
  applyDeviceContext(self, device, evt)
Apply event attributes from device context.
  applyEventContext(self, evt)
Apply event and devices contexts to the event.
  buildClearUpdate(self, evt, clearcls)
Build an update statement that will clear related events.
  buildDetailInsert(self, evid, detaildict)
Build an insert to add detail values from an event to the details table.
  buildInsert(self, datadict, table)
Build a insert statement for that looks like this: insert into status set field='value', field=1, ...
  buildStatusInsert(self, statusdata, table, evid)
Build an insert statement for the status table that looks like this: insert into status set device='box', count=1, ...
  doSendEvent(self, event)
  escape(self, value)
Prepare string values for db by escaping special characters.
  eventDataMaps(self, event)
Return tuple (statusdata, detaildata) for this event.
  sendEvent(self, event)
Send an event to the backend.
  _sendHeartbeat(self, event)
Build insert to add heartbeat record to heartbeat table.

Method Details

applyDeviceContext(self, device, evt)

Apply event attributes from device context.

applyEventContext(self, evt)

Apply event and devices contexts to the event. Only valid if this object has zeo connection.

buildClearUpdate(self, evt, clearcls)

Build an update statement that will clear related events.

buildDetailInsert(self, evid, detaildict)

Build an insert to add detail values from an event to the details table.

buildInsert(self, datadict, table)

Build a insert statement for that looks like this: insert into status set field='value', field=1, ...

buildStatusInsert(self, statusdata, table, evid)

Build an insert statement for the status table that looks like this:
insert into status set device='box', count=1, ...
    on duplicate key update count=count+1, lastTime=23424.34;

escape(self, value)

Prepare string values for db by escaping special characters.

eventDataMaps(self, event)

Return tuple (statusdata, detaildata) for this event.

sendEvent(self, event)

Send an event to the backend.

_sendHeartbeat(self, event)

Build insert to add heartbeat record to heartbeat table.

Generated by Epydoc 2.1 on Thu Aug 16 09:55:11 2007 http://epydoc.sf.net