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