{"size": 1234, "ext": "js", "max_stars_repo_path": "lib/client/jenkinsBuildManager.js", "max_stars_repo_name": "jamesjenner/Vor", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "lib/client/jenkinsBuildManager.js", "max_issues_repo_name": "jamesjenner/Vor", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "lib/client/jenkinsBuildManager.js", "max_forks_repo_name": "jamesjenner/Vor", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 28.0454545455, "max_line_length": 126, "alphanum_fraction": 0.6936790924}
/* jshint browser: true, jquery: true */
/* global AgileSprint:false, console:false */


var JenkinsBuildManager = function(options) {
//  if(options.server === null || options.server === undefined) {
//    return null;
//  }
  
  this.widgetManager = (options.widgetManager !== null && options.widgetManager !== undefined) ? options.widgetManager : null;
  this.panelManager = (options.panelManager !== null && options.panelManager !== undefined) ? options.panelManager : null;
  
  this.server = options.server;
};

JenkinsBuildManager.prototype.processMessages = function(server, id, content) {
  var processed = false;

  switch (id) {
    case JenkinsState.MESSAGE_STATS:
      this.__receivedStats(server, content);
      processed = true;
      break;
      
    case JenkinsState.MESSAGE_CONNECTIVITY_ERROR:
      this.__receivedError(server, content);
      processed = true;
      break;
  }

  return processed;
};

JenkinsBuildManager.prototype.__receivedStats = function(server, d) {
  if(this.widgetManager !== null) {
    this.widgetManager.receivedData(d);
  }
};

JenkinsBuildManager.prototype.__receivedError = function(server, d) {
  if(this.widgetManager !== null) {
    this.widgetManager.receivedError(d);
  }
};