Description:
The GetList method retrieves an iterable list of
entries from the log event database. The database contains two types of entries,
log entries (all entries) and recent log entries (a subset of all log entries).
This method can be called both synchronously and asynchronously.
Syntax:
For synchronous calls:
GetList(parameters:Object):Object
For asynchronous calls:
GetList(parameters:Object, callback:Object):Object
Arguments:
parameters:
This is an object that specifies what information is returned from the log event database. For more information about the object properties and how to define them, see section Parameters for retrieving log events.
callback:
The callback argument is the name of the method
that is executed when an asynchronous GetList call has
results or status information to return. You must define this method separately.
Follow the instructions in section Defining the callback handler for an asynchronous method to
define the callback method.
This argument is used only with an asynchronous GetList call.
Return value:
If synchronous, the GetList method returns an object
that contains the requested log event information, an error code, and an error
message.
|
Property |
Description |
Value |
|---|---|---|
|
|
This is an iterator that contains the requested log event information. |
|
|
|
This is a number that specifies a predefined error code. |
See Service API error codes . |
|
|
This is a text string that describes the error. |
If asynchronous, the GetList method returns an
object that contains the initial return value from the asynchronous call that
it started (see the following table). The actual information is returned by
the callback method
in the ReturnValue property of its result object. The
returned information is described in section Returned log event information.
|
Property |
Description |
Value |
|---|---|---|
|
|
This is a number used as an identification to match transactions started
with the asynchronous This property is only valid for asynchronous calls. |
|
|
|
This is a number that specifies a predefined error code. |
|
|
|
This is a text string that describes the error. |
Remarks:
To access information about individual log events, iterate through the
list of objects contained in ReturnValue.
Example code:
The following sample code illustrates how to retrieve a specific event from the log synchronously:
import com.nokia.lib.Service;
var logging = new Service("Service.Logging", "IDataSource");
var filter = {EventType:0};
var inParams = {Type:"Log", Filter:filter};
var outParams = logging.GetList(inParams);
var outList = outParams.ReturnValue;
var outputEntry = null;
do {
outputEntry = outList.next();
if (null != outputEntry) {
var logId = outputEntry.id;
} else {
break;
}
} while (true);
The following sample code illustrates how to retrieve a specific event from the log asynchronously:
import com.nokia.lib.Service;
var logging = new Service("Service.Logging", "IDataSource");
var filter = {EventType:0};
var inParams = {Type:"Log", Filter:filter};
logging.GetList(inParams, onReceive);
function onReceive (transactionID:Number, eventID:String, outParam:Object) {
var outList = outParam.ReturnValue;
var outputEntry = null;
do {
outputEntry = outList.next();
if (null != outputEntry) {
var logId = outputEntry.id;
} else {
break;
}
} while (true);
}