Module: RSMP::SupervisorProxy::Modules::AggregatedStatus
- Included in:
- RSMP::SupervisorProxy
- Defined in:
- lib/rsmp/proxy/supervisor/modules/aggregated_status.rb
Overview
Handles aggregated status messages
Instance Method Summary collapse
- #process_aggregated_status_request(message) ⇒ Object
-
#send_aggregated_status(component, options = {}) ⇒ Object
Send aggregated status for a component.
- #send_all_aggregated_status ⇒ Object
Instance Method Details
#process_aggregated_status_request(message) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/rsmp/proxy/supervisor/modules/aggregated_status.rb', line 37 def process_aggregated_status_request() log "Received #{message.type}", message: , level: :log component_id = .attributes['cId'] component = @site.find_component component_id acknowledge send_aggregated_status component end |
#send_aggregated_status(component, options = {}) ⇒ Object
Send aggregated status for a component
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/rsmp/proxy/supervisor/modules/aggregated_status.rb', line 13 def send_aggregated_status(component, = {}) m_id = [:m_id] || RSMP::Message.make_m_id se = if Proxy.version_meets_requirement?(core_version, '<=3.1.2') component.aggregated_status_bools.map { |bool| bool ? 'true' : 'false' } else component.aggregated_status_bools end = RSMP::AggregatedStatus.new({ 'aSTS' => clock.to_s, 'cId' => component.c_id, 'fP' => nil, 'fS' => nil, 'se' => se, 'mId' => m_id }) send_and_optionally_collect , do || Collector.new self, .merge(task: @task, type: 'MessageAck') end end |
#send_all_aggregated_status ⇒ Object
6 7 8 9 10 |
# File 'lib/rsmp/proxy/supervisor/modules/aggregated_status.rb', line 6 def send_all_aggregated_status @site.components.each_pair do |_c_id, component| send_aggregated_status component if component.grouped end end |