Class: Contrast::Agent::Reporting::ResponseHandlerMode
- Defined in:
- lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb
Overview
This class will hold the mode state in which the reporter will send event ot TS.
Instance Attribute Summary collapse
-
#disabled ⇒ Symbol
readonly
Reader for the disabled mode type.
-
#modes ⇒ Array<Symbol>
readonly
Reader for all supported modes.
-
#resending ⇒ Symbol
readonly
Reader for the resending/retry mode type.
-
#running ⇒ Symbol
readonly
Reader for the running mode type.
Instance Method Summary collapse
- #enter_resend_mode ⇒ Object
-
#enter_run_mode ⇒ Object
Reset mode.
-
#initialize ⇒ ResponseHandlerMode
constructor
A new instance of ResponseHandlerMode.
-
#resend ⇒ Contrast::Agent::Reporting::Resend::Status
Resend Status tracker.
-
#status ⇒ Symbol
Current mode.
-
#status=(mode) ⇒ Symbol
Set current mode.
Constructor Details
#initialize ⇒ ResponseHandlerMode
Returns a new instance of ResponseHandlerMode.
34 35 36 37 38 39 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 34 def initialize @running = :running @disabled = :disabled @resending = :resending @modes = [@running, @disabled, @resending].cs__freeze end |
Instance Attribute Details
#disabled ⇒ Symbol (readonly)
Reader for the disabled mode type.
due to received Error. The Reporting is disabled for this application.
21 22 23 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 21 def disabled @disabled end |
#modes ⇒ Array<Symbol> (readonly)
Reader for all supported modes.
available modes of operation.
32 33 34 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 32 def modes @modes end |
#resending ⇒ Symbol (readonly)
Reader for the resending/retry mode type.
for a TS received amount of time and will try to resend the previous request after that.
27 28 29 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 27 def resending @resending end |
#running ⇒ Symbol (readonly)
Reader for the running mode type.
and responses are being processed.
16 17 18 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 16 def running @running end |
Instance Method Details
#enter_resend_mode ⇒ Object
56 57 58 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 56 def enter_resend_mode @_status = resending end |
#enter_run_mode ⇒ Object
Reset mode
70 71 72 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 70 def enter_run_mode @_status = running end |
#resend ⇒ Contrast::Agent::Reporting::Resend::Status
Resend Status tracker
52 53 54 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 52 def resend @_resend ||= Contrast::Agent::Reporting::Resend::Status.new end |
#status ⇒ Symbol
Current mode.
current mode of operation.
45 46 47 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 45 def status @_status ||= running end |
#status=(mode) ⇒ Symbol
Set current mode.
current mode of operation.
64 65 66 |
# File 'lib/contrast/agent/reporting/reporting_utilities/response_handler_mode.rb', line 64 def status= mode @_status = mode if mode.cs__is_a?(Symbol) && modes.include?(mode) end |