Package jenkins.model
Class BuildDiscarder
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<BuildDiscarder>
-
- jenkins.model.BuildDiscarder
-
- All Implemented Interfaces:
ExtensionPoint,Describable<BuildDiscarder>
- Direct Known Subclasses:
LogRotator
public abstract class BuildDiscarder extends AbstractDescribableImpl<BuildDiscarder> implements ExtensionPoint
Implementation of "Discard old build records" feature.This extension point allows plugins to implement a different strategy to decide what builds to discard and what builds to keep.
- Since:
- 1.503
- Author:
- Kohsuke Kawaguchi
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classBuildDiscarder.ConverterImplJob.logRotatorused to be typed asLogRotator, so such configuration file ends up trying to unmarshalBuildDiscarderand not its subtype.-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description BuildDiscarder()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BuildDiscarderDescriptorgetDescriptor()By default looks for a nested class (conventionally namedDescriptorImpl) implementingDescriptorand marked withExtension.abstract voidperform(Job<?,?> job)Called to perform "garbage collection" on the job to discard old build records.
-
-
-
Method Detail
-
perform
public abstract void perform(Job<?,?> job) throws IOException, InterruptedException
Called to perform "garbage collection" on the job to discard old build records.Normally invoked automatically jobs when new builds occur. The general expectation is that those marked as
Run.isKeepLog()will be kept untouched. To delete the build record, callRun.delete().- Throws:
IOExceptionInterruptedException- See Also:
Job.logRotate()
-
getDescriptor
public BuildDiscarderDescriptor getDescriptor()
Description copied from class:AbstractDescribableImplBy default looks for a nested class (conventionally namedDescriptorImpl) implementingDescriptorand marked withExtension.Gets the descriptor for this instance.
Descriptoris a singleton for every concreteDescribableimplementation, so ifa.getClass() == b.getClass()then by defaulta.getDescriptor() == b.getDescriptor()as well. (In rare cases a single implementation class may be used for instances with distinct descriptors.)- Specified by:
getDescriptorin interfaceDescribable<BuildDiscarder>- Overrides:
getDescriptorin classAbstractDescribableImpl<BuildDiscarder>
-
-