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.
Constructor Attributes | Constructor Name and Description |
---|---|
Event(proto)
Constructs a new instance of an Event object, which can be sent to Sentinel.
|
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.
|
|
setBeginTime(time)
Sets the BeginTime field to the time the event(s) began according to the event source.
|
|
setEndTime(time)
Sets the EndTime field to the time the event(s) ended according to the event source.
|
|
setObserverEventTime(time)
Sets the ObserverEventTime and ObserverEventTimeString to the time according to the event source.
|
|
setTaxKey(key)
Sets the taxonomy key to be used when constructing the output Event.
|
- Parameters:
- {Event} proto
- The prototype or template event that should be cloned to create this new Event
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
- Parameters:
- {DataMap} datamap
- The map to use (optional) when converting the 'rec' object into the Event. Will default to Rec2Evt.
- Returns:
- {Boolean} Result
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
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
- ObserverEventTimeString
- A string representation of the time, according to the event source, that the event occurred.
- ObserverEventTime
- A timestamp representation of the time, according to the event source, that the event occurred; if the event source clock is trusted, this will be copied to EventTime.
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.setObserverEventTime(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
The taxonomy key is used to set the following Event fields:
- Event.TaxonomyLevel1
- Event.TaxonomyLevel2
- Event.TaxonomyLevel3
- Event.TaxonomyLevel4
- Event.XDASEventName
- Event.XDASEventOutcome
- Event.XDASRegistry
- Event.XDASProvider
- Event.XDASClass
- Event.XDASIdentifier
- Event.XDASOutcome
- Event.XDASDetail
- Parameters:
- {String} key
- The string to use as the taxonomy key
- Returns:
- {Boolean} Result