3d5d5d39f4becfea40e5331201901a40ee2ea0dc
[packages/precise/mcollective.git] / plugins / mcollective / agent / discovery.rb
1 module MCollective
2   module Agent
3     # Discovery agent for The Marionette Collective
4     #
5     # Released under the Apache License, Version 2
6     class Discovery
7       attr_reader :timeout, :meta
8
9       def initialize
10         config = Config.instance.pluginconf
11
12         @timeout = 5
13         @meta = {:license => "Apache License, Version 2",
14                  :author => "R.I.Pienaar <rip@devco.net>",
15                  :timeout => @timeout,
16                  :name => "Discovery Agent",
17                  :version => MCollective.version,
18                  :url => "http://www.marionette-collective.org",
19                  :description => "MCollective Discovery Agent"}
20       end
21
22       def handlemsg(msg, stomp)
23         reply = "unknown request"
24
25         case msg[:body]
26           when "ping"
27             reply = "pong"
28
29           else
30             reply = "Unknown Request: #{msg[:body]}"
31         end
32
33         reply
34       end
35     end
36   end
37 end