Class: Isono::NodeModules::NodeCollector
- Includes:
- Logger
- Defined in:
- lib/isono/node_modules/node_collector.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
Methods included from Logger
Methods inherited from Base
#config_section, #initialize, #manifest, #value_object
Constructor Details
This class inherits a constructor from Isono::NodeModules::Base
Instance Method Details
#list ⇒ Object
64 65 66 |
# File 'lib/isono/node_modules/node_collector.rb', line 64 def list Models::NodeState.dataset.all.map{|r| r.values } end |
#notify(node_id, boot_token) ⇒ Object
68 69 70 71 72 73 74 75 76 77 78 79 80 81 |
# File 'lib/isono/node_modules/node_collector.rb', line 68 def notify(node_id, boot_token) event = EventChannel.new(node) a = Models::NodeState.find(:node_id=>node_id) || Models::NodeState.new(:node_id=>node_id) a.process_event(:on_ping) if a.new? a.boot_token = boot_token a.save event.publish('node_collector/monitored', :args=>[a.values]) else a.save_changes #event.publish('node_collector/pong') end end |