Class: TCellAgent::SensorEvents::TCellRedirectSensorEvent

Inherits:
TCellSensorEvent
  • Object
show all
Defined in:
lib/tcell_agent/sensor_events/sensor.rb

Instance Attribute Summary

Attributes inherited from TCellSensorEvent

#ensure, #flush, #send

Instance Method Summary collapse

Methods inherited from TCellSensorEvent

#bucket_key, #calculateOffset

Constructor Details

#initialize(redirect_domain, original_domain, original_url, method, route_id, status_code, remote_addr, session_id = nil, user_id = nil) ⇒ TCellRedirectSensorEvent

Returns a new instance of TCellRedirectSensorEvent.



47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 47

def initialize(redirect_domain, original_domain, original_url, method, route_id, status_code, remote_addr, session_id=nil, user_id=nil)
    super("redirect")
    @raw_original_url = original_url
    self["method"] = method
    self["from_domain"] = original_domain
    self["status_code"] = status_code
    self["remote_addr"] = remote_addr
    if route_id
        self["rid"] = route_id
    end
    @raw_redirect_domain = redirect_domain
    @user_id = user_id
    @raw_session_id = session_id
end

Instance Method Details

#post_processObject



61
62
63
64
65
66
67
68
# File 'lib/tcell_agent/sensor_events/sensor.rb', line 61

def post_process
    self["from"] = Util.strip_uri_values(@raw_original_url)
    self["to"] = @raw_redirect_domain
    if @raw_session_id
        hmac_key = Util.getHmacKey()
        self["sid"] = Util.hmac(@raw_session_id, hmac_key)
    end
end