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 class
BuildDiscarder.ConverterImpl
Job.logRotator
used to be typed asLogRotator
, so such configuration file ends up trying to unmarshalBuildDiscarder
and 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 BuildDiscarderDescriptor
getDescriptor()
By default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.abstract void
perform(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:
IOException
InterruptedException
- See Also:
Job.logRotate()
-
getDescriptor
public BuildDiscarderDescriptor getDescriptor()
Description copied from class:AbstractDescribableImpl
By default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.Gets the descriptor for this instance.
Descriptor
is a singleton for every concreteDescribable
implementation, 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:
getDescriptor
in interfaceDescribable<BuildDiscarder>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<BuildDiscarder>
-
-