Package jenkins.model
Class SimpleGlobalBuildDiscarderStrategy
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<GlobalBuildDiscarderStrategy>
-
- jenkins.model.GlobalBuildDiscarderStrategy
-
- jenkins.model.SimpleGlobalBuildDiscarderStrategy
-
- All Implemented Interfaces:
ExtensionPoint,Describable<GlobalBuildDiscarderStrategy>
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public class SimpleGlobalBuildDiscarderStrategy extends GlobalBuildDiscarderStrategy
Apply a user-specified build discarder periodically on all jobs.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleGlobalBuildDiscarderStrategy.DescriptorImpl-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description SimpleGlobalBuildDiscarderStrategy(BuildDiscarder discarder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(Job<?,?> job)Applies this build discarder strategy to the given job, i.e.BuildDiscardergetDiscarder()booleanisApplicable(Job<?,?> job)Returns true if and only if this strategy applies to the given job.-
Methods inherited from class jenkins.model.GlobalBuildDiscarderStrategy
apply
-
Methods inherited from class hudson.model.AbstractDescribableImpl
getDescriptor
-
-
-
-
Constructor Detail
-
SimpleGlobalBuildDiscarderStrategy
@DataBoundConstructor public SimpleGlobalBuildDiscarderStrategy(BuildDiscarder discarder)
-
-
Method Detail
-
getDiscarder
public BuildDiscarder getDiscarder()
-
isApplicable
public boolean isApplicable(Job<?,?> job)
Description copied from class:GlobalBuildDiscarderStrategyReturns true if and only if this strategy applies to the given job.- Specified by:
isApplicablein classGlobalBuildDiscarderStrategy- Returns:
- true if and only if this strategy applies to the given job.
-
apply
public void apply(Job<?,?> job) throws IOException, InterruptedException
Description copied from class:GlobalBuildDiscarderStrategyApplies this build discarder strategy to the given job, i.e. delete builds based on this strategy's configuration. The default implementation callsGlobalBuildDiscarderStrategy.apply(Run)on each build.- Overrides:
applyin classGlobalBuildDiscarderStrategy- Throws:
IOExceptionInterruptedException
-
-