12: def initialize(args)
13: raise ArgumentError, ":protocols must be specified." if !args[:protocols] or args[:protocols].empty?
14: protocols = args[:protocols]
15:
16:
17: @rest_http_handler = Puppet::Network::HTTP::RackREST.new
18: protocols.delete :rest
19:
20:
21: @xmlrpc_path = '/RPC2'
22: if args[:protocols].include?(:xmlrpc)
23: raise ArgumentError, "XMLRPC was requested, but no handlers were given" if !args.include?(:xmlrpc_handlers)
24:
25: @xmlrpc_http_handler = Puppet::Network::HTTP::RackXMLRPC.new(args[:xmlrpc_handlers])
26: protocols.delete :xmlrpc
27: end
28:
29: raise ArgumentError, "there were unknown :protocols specified." if !protocols.empty?
30: end