File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\core\src\main\java\jenkins\model\BuildDiscarder.java.html

1 package jenkins.model;
2
3 import hudson.ExtensionPoint;
4 import hudson.model.AbstractDescribableImpl;
5 import hudson.model.Job;
6 import hudson.model.Run;
7
8 import java.io.IOException;
9
10 /**
11 * Implementation of "Discard old build records" feature.
12 *
13 * <p>
14 * This extension point allows plugins to implement a different strategy to decide what builds to discard
15 * and what builds to keep.
16 *
17 * @author Kohsuke Kawaguchi
18 * @since 1.503
19 */
20 public abstract class BuildDiscarder extends AbstractDescribableImpl<BuildDiscarder> implements ExtensionPoint {
21 /**
22 * Called to perform "garbage collection" on the job to discard old build records.
23 *
24 * <p>
25 * Normally invoked automatically jobs when new builds occur.
26 * The general expectation is that those marked as {@link Run#isKeepLog()} will be kept untouched.
27 * To delete the build record, call {@link Run#delete()}.
28 *
29 * @see Job#logRotate()
30 */
31 public abstract void perform(Job<?,?> job) throws IOException, InterruptedException;
32
33 @Override
34 public BuildDiscarderDescriptor getDescriptor() {
35 return (BuildDiscarderDescriptor)super.getDescriptor();
36 }
37 }
38