RequestNotification
is used to request notification for the updates occurring to log and register for any changes happening to event log.
It is used in asynchronous mode only.
The following is an example for using RequestNotification
:
logging_id = logging_handle.call('RequestNotification', {'Type': u'Log', 'Filter': {'DelayTime': 600000}}, callback=logging_app_callback)
where, logging_app_callback
is user defined function.
The following table summarizes the specification of RequestNotification
:
Interface | IDataSource |
Description | Registers for the changes occurring to the event log. |
Response Model | Asynchronous |
Pre-condition | IDataSource interface is loaded. |
Post-condition | Nil |
Input Parameters
Input parameter specifies the Type and delay time in microseconds, which elapses before the notification request can complete.
|
Output Parameters
Output contains ErrorCode
and ErrorMessage
, if the operation fails.
|
Errors
The following table lists the error codes and their values:
|
Error Messages
The following table lists the error messages and their description:
|
Example
The following sample code illustrates how to register changes in the event log, in asynchronous mode:
import scriptext import e32 lock = e32.Ao_lock() def logging_app_callback(trans_id, event_id, input_params): if trans_id != logging_id and event_id != scriptext.EventCompleted: print "Error in servicing the request" print "Error code is: " + str(input_params["ReturnValue"]["ErrorCode"]) if "ErrorMessage" in input_params["ReturnValue"]: print "Error message is: " + input_params["ReturnValue"]["ErrorMessage"] else: print "Changes in the Log Event Notified " lock.signal() # Load appmanage service # Load the desired SAPI logging_handle = scriptext.load('Service.Logging', 'IDataSource') logging_id = logging_handle.call('RequestNotification', {'Type': u'Log', 'Filter': {'DelayTime': 600000}}, callback=logging_app_callback) print "Waiting for the request to be processed!" lock.wait() print "Request complete!"
See About this document... for information on suggesting changes.