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

1 package hudson.cli;
2
3 import hudson.model.AbstractBuild;
4 import hudson.model.AbstractProject;
5 import hudson.model.Fingerprint.RangeSet;
6 import org.kohsuke.args4j.Argument;
7
8 import java.io.IOException;
9 import java.util.List;
10
11 /**
12 * {@link CLICommand} that acts on a series of {@link AbstractBuild}s.
13 *
14 * @author Kohsuke Kawaguchi
15 */
16 public abstract class AbstractBuildRangeCommand extends CLICommand {
17 @Argument(metaVar="JOB",usage="Name of the job to build",required=true,index=0)
18 public AbstractProject<?,?> job;
19
20 @Argument(metaVar="RANGE",usage="Range of the build records to delete. 'N-M', 'N,M', or 'N'",required=true,index=1)
21 public String range;
22
23 protected int run() throws Exception {
24 RangeSet rs = RangeSet.fromString(range,false);
25
26 return act((List)job.getBuilds(rs));
27 }
28
29 protected abstract int act(List<AbstractBuild<?,?>> builds) throws IOException;
30 }
31