Class ScoringLoadBalancer.DescriptorImpl

java.lang.Object
hudson.model.Descriptor<ScoringLoadBalancer>
jp.ikedam.jenkins.plugins.scoringloadbalancer.ScoringLoadBalancer.DescriptorImpl
All Implemented Interfaces:
Saveable, Loadable, OnMaster
Enclosing class:
ScoringLoadBalancer

@Extension @Symbol("scoringLoadBalancer") public static class ScoringLoadBalancer.DescriptorImpl extends Descriptor<ScoringLoadBalancer>
Descriptor for ScoringLoadBalancer Manages views and holds configuration for ScoringLoadBalancer.
  • Constructor Details

    • DescriptorImpl

      public DescriptorImpl()
      Constructor. Restore configurations.
  • Method Details

    • isEnabled

      public boolean isEnabled()
      Returns whether ScoringLoadBalancer is enabled
      Returns:
      whether ScoringLoadBalancer is enabled
    • isReportScoresEnabled

      public boolean isReportScoresEnabled()
      Returns whether to log scores of nodes in each load balancing calculation. Enabling this makes many outputs, and not good for production environments.
      Returns:
      whether to log scores of nodes
    • isSimultaneousBuildsWorkaroundEnabled

      public boolean isSimultaneousBuildsWorkaroundEnabled()
      Returns whether to enable the workaround for simultaneous builds, which throttles builds / only allows a single build to start within a certain time.
      Returns:
      whether to enable the workaround and throttle builds.
    • getSimultaneousBuildsWorkaroundThrottleTime

      public int getSimultaneousBuildsWorkaroundThrottleTime()
      Returns the throttle time of the workaround for simultaneous builds, which only allows a single build to start within the amount of milliseconds that is returned by this method.
      Returns:
      the throttle time in milliseconds of the workaround.
    • getScoringRuleList

      public List<ScoringRule> getScoringRuleList()
      Returns the list of enabled scoring rules.
      Returns:
      the enabled scoring rules.
    • configure

      public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException
      Update and store configuration.
      Overrides:
      configure in class Descriptor<ScoringLoadBalancer>
      Parameters:
      req -
      json -
      Returns:
      Throws:
      Descriptor.FormException
      See Also:
    • configure

      public boolean configure(boolean enabled, boolean reportScoresEnabled, boolean simultaneousBuildsWorkaroundEnabled, int simultaneousBuildsWorkaroundThrottleTime, List<ScoringRule> scoringRuleList)
      Used for testing purpose.
      Parameters:
      enabled -
      reportScoresEnabled -
      simultaneousBuildsWorkaroundEnabled -
      simultaneousBuildsWorkaroundThrottleTime -
      scoringRuleList -
      Returns:
    • configure

      public boolean configure(boolean enabled, boolean reportScoresEnabled, boolean simultaneousBuildsWorkaroundEnabled, int simultaneousBuildsWorkaroundThrottleTime, ScoringRule... scoringRules)
      Used for testing purpose.
      Parameters:
      enabled -
      reportScoresEnabled -
      simultaneousBuildsWorkaroundEnabled -
      simultaneousBuildsWorkaroundThrottleTime -
      scoringRules -
      Returns:
    • setEnabled

      @DataBoundSetter public void setEnabled(boolean enabled)
    • setReportScoresEnabled

      @DataBoundSetter public void setReportScoresEnabled(boolean reportScoresEnabled)
    • setSimultaneousBuildsWorkaroundEnabled

      @DataBoundSetter public void setSimultaneousBuildsWorkaroundEnabled(boolean simultaneousBuildsWorkaroundEnabled)
    • setSimultaneousBuildsWorkaroundThrottleTime

      @DataBoundSetter public void setSimultaneousBuildsWorkaroundThrottleTime(int simultaneousBuildsWorkaroundThrottleTime)
    • setScoringRuleList

      @DataBoundSetter public void setScoringRuleList(List<ScoringRule> scoringRuleList)
    • getDisplayName

      public String getDisplayName()
      Returns the name to display. Displayed in System Configuration page as a section title.
      Overrides:
      getDisplayName in class Descriptor<ScoringLoadBalancer>
      Returns:
      the name to display
      See Also:
    • getAllScoringRuleList

      public DescriptorExtensionList<ScoringRule,Descriptor<ScoringRule>> getAllScoringRuleList()
      Returns all ScoringRules registered to Jenkins.
      Returns:
      list of Descriptor of ScoringRules.