Class Index | File Index

Classes


Class Event

Represents a Sentinel event that can be sent up to the Collector Manager. In general, Event objects are not manipulated directly as the field values need to be protected, but are manipulated via methods.
Defined in: event.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Event(proto)
Constructs a new instance of an Event object, which can be sent to Sentinel.
Method Summary
Method Attributes Method Name and Description
 
add2EI(name, val)
Adds the arguments to the Sentinel ExtendedInformation field.
 
send(datamap)
Sends an event to the Collector Manager.
 
Sets the BeginTime field to the time the event(s) began according to the event source.
 
Sets the DeviceEventTime and DeviceEventTimeString to the time according to the event source.
 
setEndTime(time)
Sets the EndTime field to the time the event(s) ended according to the event source.
 
setTaxKey(key)
Sets the taxonomy key to be used when constructing the output Event.
Class Detail
Event(proto)
Constructs a new instance of an Event object, which can be sent to Sentinel. The constructor can take an object or JSON string as input to set pre-defined fields, e.g. constants for initialization of the new Event object.
Parameters:
{Event} proto
The prototype or template event that should be cloned to create this new Event
Method Detail
{Boolean} add2EI(name, val)
Adds the arguments to the Sentinel ExtendedInformation field. Sentinel's ExtendedInformation field has a pre-defined internal format as name-value pair. To enforce this format, use this method to add data to this field.

Example:

curEvt.add2EI( "CustomData", rec.s_RXBufferString.substr(20,30);
Parameters:
{String} name
The attribute name that will be set
{String} val
The value for that attribute
Returns:
{Boolean} A Boolean to indicate successful completion

{Boolean} send(datamap)
Sends an event to the Collector Manager. This method consumes the input record object to set fields in the output event, as well as performing some additional processing.
Parameters:
{DataMap} datamap
The map to use (optional) when converting the 'rec' object into the Event. Will default to Rec2Evt.
Returns:
{Boolean} Result

{Boolean} setBeginTime(time)
Sets the BeginTime field to the time the event(s) began according to the event source.

Note that you must pass a Date object to this method; you must therefore first convert whatever textual representation of the date and time is embedded in the input record into a Date object. We have included the date.js library to make this easier. You should be able to pass it almost any datetime representation and have it correctly create a Date, but note that in some cases you may need to add missing year and/or timezone information.

Record.prototype.parse = function(e) {
 this.begintime = Date.parse(this.s_RXBufferString.substr(0,30));
 e.setBeginTime(this.begintime);
Parameters:
{Date} time
The date/time the event(s) began according to the event source. This MUST be a Date object.
Returns:
{Boolean} A Boolean to indicate successful completion

{Boolean} setDeviceEventTime(time)
Sets the DeviceEventTime and DeviceEventTimeString to the time according to the event source. The Sentinel event schema includes two fields:
DeviceEventTimeString
A string which represents the time according to the event source; this is always expressed in local time according to the Collector Manager, since that's where the time is processed.
DeviceEventTime
A field of Date type which represents the time according to the event source
Both fields will be set by this method.

Note that you must pass a Date object to this method; you must therefore first convert whatever textual representation of the date and time is embedded in the input record into a Date object. We have included the date.js library to make this easier. You should be able to pass it almost any datetime representation and have it correctly create a Date, but note that in some cases you may need to add missing year and/or timezone information.

Record.prototype.parse = function(e) {
 this.devtime = Date.parse(this.s_RXBufferString.substr(0,30));
 e.setDeviceEventTime(this.devtime);
Parameters:
{Date} time
The date/time according to the event source. This MUST be a Date object.
Returns:
{Boolean} A Boolean to indicate successful completion

{Boolean} setEndTime(time)
Sets the EndTime field to the time the event(s) ended according to the event source.

Note that you must pass a Date object to this method; you must therefore first convert whatever textual representation of the date and time is embedded in the input record into a Date object. We have included the date.js library to make this easier. You should be able to pass it almost any datetime representation and have it correctly create a Date, but note that in some cases you may need to add missing year and/or timezone information.

Record.prototype.parse = function(e) {
 this.endtime = Date.parse(this.s_RXBufferString.substr(0,30));
 e.setEndTime(this.endtime);
Parameters:
{Date} time
The date/time the event(s) ended according to the event source. This MUST be a Date object.
Returns:
{Boolean} A Boolean to indicate successful completion

{Boolean} setTaxKey(key)
Sets the taxonomy key to be used when constructing the output Event. The taxonomy key is used to determine the taxonomy classification for the event. It should include enough information to determine the type of action taken as well as the outcome of the event (status or result). The key needs to match one of the entries in the taxonomy KeyMap, which is loaded from the taxonomy.map file.

The taxonomy key is used to set the following Event fields:

Parameters:
{String} key
The string to use as the taxonomy key
Returns:
{Boolean} Result

©2008
Documentation generated by JsDoc Toolkit 2.0.2 on Thu Oct 07 2010 07:23:17 GMT-0400 (EDT)