Class ScoringLoadBalancer.DescriptorImpl
java.lang.Object
hudson.model.Descriptor<ScoringLoadBalancer>
jp.ikedam.jenkins.plugins.scoringloadbalancer.ScoringLoadBalancer.DescriptorImpl
- Enclosing class:
- ScoringLoadBalancer
@Extension
@Symbol("scoringLoadBalancer")
public static class ScoringLoadBalancer.DescriptorImpl
extends Descriptor<ScoringLoadBalancer>
Descriptor for
ScoringLoadBalancer
Manages views and holds configuration for ScoringLoadBalancer
.-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
configure
(boolean enabled, boolean reportScoresEnabled, boolean simultaneousBuildsWorkaroundEnabled, int simultaneousBuildsWorkaroundThrottleTime, List<ScoringRule> scoringRuleList) Used for testing purpose.boolean
configure
(boolean enabled, boolean reportScoresEnabled, boolean simultaneousBuildsWorkaroundEnabled, int simultaneousBuildsWorkaroundThrottleTime, ScoringRule... scoringRules) Used for testing purpose.boolean
configure
(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) Update and store configuration.Returns allScoringRule
s registered to Jenkins.Returns the name to display.Returns the list of enabled scoring rules.int
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.boolean
Returns whether ScoringLoadBalancer is enabledboolean
Returns whether to log scores of nodes in each load balancing calculation.boolean
Returns whether to enable the workaround for simultaneous builds, which throttles builds / only allows a single build to start within a certain time.void
setEnabled
(boolean enabled) void
setReportScoresEnabled
(boolean reportScoresEnabled) void
setScoringRuleList
(List<ScoringRule> scoringRuleList) void
setSimultaneousBuildsWorkaroundEnabled
(boolean simultaneousBuildsWorkaroundEnabled) void
setSimultaneousBuildsWorkaroundThrottleTime
(int simultaneousBuildsWorkaroundThrottleTime) Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalConfigPage, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
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
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 classDescriptor<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
-
getDisplayName
Returns the name to display. Displayed in System Configuration page as a section title.- Overrides:
getDisplayName
in classDescriptor<ScoringLoadBalancer>
- Returns:
- the name to display
- See Also:
-
getAllScoringRuleList
Returns allScoringRule
s registered to Jenkins.- Returns:
- list of
Descriptor
ofScoringRule
s.
-