Class: TCellAgent::SensorEvents::TCellAppSensorEvent

Inherits:
TCellSensorEvent show all
Defined in:
lib/tcell_agent/sensor_events/appsensor_event.rb

Instance Attribute Summary

Attributes inherited from TCellSensorEvent

#ensure, #flush, #send

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculateOffset, #post_process

Constructor Details

#initialize(location, detection_point, method, remote_address, param, route_id, meta, hmac_session_id, user_id, payload, pattern, full_uri) ⇒ TCellAppSensorEvent

Returns a new instance of TCellAppSensorEvent.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/tcell_agent/sensor_events/appsensor_event.rb', line 7

def initialize(location,
               detection_point,
               method,
               remote_address,
               param,
               route_id,
               meta,
               hmac_session_id,
               user_id,
               payload,
               pattern,
               full_uri)
  super("as")
  self["dp"] = detection_point

  self["param"] = param.to_s if param
  self["m"] = method.to_s if method
  self["pattern"] = pattern if pattern
  self["meta"] = meta if meta
  self["rid"] = route_id.to_s if route_id
  self["full_uri"] = full_uri if full_uri
  self["uri"] = location if location
  self["uid"] = user_id.to_s if user_id
  self["sid"] = hmac_session_id if hmac_session_id
  self["remote_addr"] = remote_address.to_s if remote_address
  self["payload"] = payload if payload
end

Class Method Details

.build_from_native_lib_event(event) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# File 'lib/tcell_agent/sensor_events/appsensor_event.rb', line 35

def self.build_from_native_lib_event(event)
  return TCellAppSensorEvent.new(
    event["uri"],
    event["detection_point"],
    event["method"],
    event["remote_address"],
    event["parameter"],
    event["route_id"],
    event["meta"],
    event["session_id"],
    event["user_id"],
    event["payload"],
    event["pattern"],
    event["full_uri"]
  )
end