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
Nested ClassesModifier and TypeClassDescriptionstatic classJob.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 -
Method Summary
Modifier and TypeMethodDescriptionBy default looks for a nested class (conventionally namedDescriptorImpl) implementingDescriptorand marked withExtension.abstract voidCalled 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:
IOExceptionInterruptedException- See Also:
-
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>
-