public abstract class BuildDiscarder extends AbstractDescribableImpl<BuildDiscarder> implements ExtensionPoint
This extension point allows plugins to implement a different strategy to decide what builds to discard and what builds to keep.
Modifier and Type | Class and Description |
---|---|
static class |
BuildDiscarder.ConverterImpl
Job.logRotator used to be typed as LogRotator ,
so such configuration file ends up trying to unmarshal BuildDiscarder and
not its subtype. |
ExtensionPoint.LegacyInstancesAreScopedToHudson
Constructor and Description |
---|
BuildDiscarder() |
Modifier and Type | Method and Description |
---|---|
BuildDiscarderDescriptor |
getDescriptor()
By default looks for a nested class (conventionally named
DescriptorImpl ) implementing Descriptor and marked with Extension . |
abstract void |
perform(Job<?,?> job)
Called to perform "garbage collection" on the job to discard old build records.
|
public abstract void perform(Job<?,?> job) throws IOException, InterruptedException
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, call Run.delete()
.
IOException
InterruptedException
Job.logRotate()
public BuildDiscarderDescriptor getDescriptor()
AbstractDescribableImpl
DescriptorImpl
) implementing Descriptor
and marked with Extension
.
Gets the descriptor for this instance.
Descriptor
is a singleton for every concrete Describable
implementation, so if a.getClass() == b.getClass()
then by default
a.getDescriptor() == b.getDescriptor()
as well.
(In rare cases a single implementation class may be used for instances with distinct descriptors.)
getDescriptor
in interface Describable<BuildDiscarder>
getDescriptor
in class AbstractDescribableImpl<BuildDiscarder>
Copyright © 2004–2021. All rights reserved.