Package jenkins.model
Class 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
Modifier and TypeClassDescriptionstatic class
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
-
Method Summary
Modifier and TypeMethodDescriptionBy default looks for a nested class (conventionally namedDescriptorImpl
) implementingDescriptor
and marked withExtension
.abstract void
Called to perform "garbage collection" on the job to discard old build records.
-
Constructor Details
-
BuildDiscarder
public BuildDiscarder()
-
-
Method Details
-
perform
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:
-
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>
-