Sha256: f6ee54a6a281101cc435d627725c27361a4aa29cfb1ab40d268ef34a8e5f5b79

Contents?: true

Size: 1.52 KB

Versions: 16

Compression:

Stored size: 1.52 KB

Contents

require 'puppet/util/docs'
require 'puppet/util/subclass_loader'

module Puppet::Network
    # The base class for the different handlers.  The handlers are each responsible
    # for separate xmlrpc namespaces.
    class Handler
        extend Puppet::Util::Docs

        # This is so that the handlers can subclass just 'Handler', rather
        # then having to specify the full class path.
        Handler = self
        attr_accessor :server, :local

        extend Puppet::Util::SubclassLoader
        extend Puppet::Util

        handle_subclasses :handler, "puppet/network/handler"

        # Return the xmlrpc interface.
        def self.interface
            if defined? @interface
                return @interface
            else
                raise Puppet::DevError, "Handler %s has no defined interface" %
                    self
            end
        end

        # Set/Determine whether we're a client- or server-side handler.
        def self.side(side = nil)
            if side
                side = side.intern if side.is_a?(String)
                unless [:client, :server].include?(side)
                    raise ArgumentError, "Invalid side registration '%s' for %s" % [side, self.name]
                end
                @side = side
            else
                @side ||= :server
                return @side
            end
        end

        # Create an empty init method with the same signature.
        def initialize(hash = {})
        end

        def local?
            self.local
        end
    end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
puppet-0.25.5 lib/puppet/network/handler.rb
puppet-0.25.4 lib/puppet/network/handler.rb
puppet-0.25.3 lib/puppet/network/handler.rb
puppet-0.24.9 lib/puppet/network/handler.rb
puppet-0.25.2 lib/puppet/network/handler.rb
puppet-0.25.1 lib/puppet/network/handler.rb
puppet-0.25.0 lib/puppet/network/handler.rb
puppet-0.24.0 lib/puppet/network/handler.rb
puppet-0.24.2 lib/puppet/network/handler.rb
puppet-0.24.3 lib/puppet/network/handler.rb
puppet-0.24.1 lib/puppet/network/handler.rb
puppet-0.24.4 lib/puppet/network/handler.rb
puppet-0.24.7 lib/puppet/network/handler.rb
puppet-0.24.6 lib/puppet/network/handler.rb
puppet-0.24.5 lib/puppet/network/handler.rb
puppet-0.24.8 lib/puppet/network/handler.rb