X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;ds=sidebyside;f=doc%2Fclasses%2FMCollective%2FRegistration%2FBase.html;fp=doc%2Fclasses%2FMCollective%2FRegistration%2FBase.html;h=0000000000000000000000000000000000000000;hb=7c9314f502cde8daad23b61d10b24a542e04154a;hp=1f000d8d779f1b70c8d3c3877c9161f3ff0fa5d0;hpb=d1f1649ba43c5cbc43c4beb2380096ba051d646a;p=packages%2Fprecise%2Fmcollective.git diff --git a/doc/classes/MCollective/Registration/Base.html b/doc/classes/MCollective/Registration/Base.html deleted file mode 100644 index 1f000d8..0000000 --- a/doc/classes/MCollective/Registration/Base.html +++ /dev/null @@ -1,347 +0,0 @@ - - - - -
-Class | -MCollective::Registration::Base | -
In: | -
-
- lib/mcollective/registration/base.rb
-
- - |
-
Parent: | -- Object - | -
-This is a base class that other registration plugins can use to handle -regular announcements to the mcollective -
--The configuration file determines how often registration messages gets sent -using the registerinterval option, the plugin runs in the -background in a thread. -
- --Register plugins that inherits base -
- -- # File lib/mcollective/registration/base.rb, line 11 -11: def self.inherited(klass) -12: PluginManager << {:type => "registration_plugin", :class => klass.to_s} -13: end --
- # File lib/mcollective/registration/base.rb, line 36 -36: def config -37: Config.instance -38: end --
- # File lib/mcollective/registration/base.rb, line 59 -59: def interval -60: config.registerinterval -61: end --
- # File lib/mcollective/registration/base.rb, line 40 -40: def msg_filter -41: filter = Util.empty_filter -42: filter["agent"] << "registration" -43: filter -44: end --
- # File lib/mcollective/registration/base.rb, line 63 -63: def publish(message) -64: unless message -65: Log.debug("Skipping registration due to nil body") -66: else -67: req = Message.new(message, nil, {:type => :request, :agent => "registration", :collective => target_collective, :filter => msg_filter}) -68: req.encode! -69: -70: Log.debug("Sending registration #{req.requestid} to collective #{req.collective}") -71: -72: req.publish -73: end -74: end --
-Creates a background thread that periodically send a registration notice. -
--The actual registration notices comes from the ‘body’ method of -the registration plugins. -
- -- # File lib/mcollective/registration/base.rb, line 19 -19: def run(connection) -20: return false if interval == 0 -21: -22: Thread.new do -23: loop do -24: begin -25: publish(body) -26: -27: sleep interval -28: rescue Exception => e -29: Log.error("Sending registration message failed: #{e}") -30: sleep interval -31: end -32: end -33: end -34: end --
- # File lib/mcollective/registration/base.rb, line 46 -46: def target_collective -47: main_collective = config.main_collective -48: -49: collective = config.registration_collective || main_collective -50: -51: unless config.collectives.include?(collective) -52: Log.warn("Sending registration to #{main_collective}: #{collective} is not a valid collective") -53: collective = main_collective -54: end -55: -56: return collective -57: end --