This class is the DRb interface for ProjectBroker. We only want to expose these methods for remote access.
Check the authentication key and the client/server version match. The following return values can be generated: 0 : authKey does not match 1 : client and server versions match -1 : client and server versions don’t match
# File lib/daemon/ProjectBroker.rb, line 464 464: def apiVersion(authKey, version) 465: return 0 unless @broker.checkKey(authKey, 'apiVersion') 466: 467: version == 1 ? 1 : 1 468: end
# File lib/daemon/ProjectBroker.rb, line 484 484: def command(authKey, cmd, args) 485: return false unless @broker.checkKey(authKey, cmd) 486: 487: trap do 488: case cmd 489: when :status 490: @broker.status 491: when :stop 492: @broker.stop 493: when :addProject 494: @broker.addProject 495: when :removeProject 496: @broker.removeProject(args) 497: when :getProject 498: @broker.getProject(args) 499: when :update 500: @broker.update 501: else 502: LogFile.instance.fatal('Unknown command #{cmd} called') 503: end 504: end 505: end
This function catches all unhandled exceptions in the passed block.
# File lib/daemon/ProjectBroker.rb, line 471 471: def trap 472: log = LogFile.instance 473: 474: begin 475: yield 476: rescue 477: $stderr.print $!.to_s 478: $stderr.print $!.backtrace.join("\n") 479: log.debug($!.backtrace.join("\n")) 480: log.fatal("Unexpected exception: #{$!}") 481: end 482: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.