public abstract class ParameterizedJobMixIn<JobT extends Job<JobT,RunT> & ParameterizedJobMixIn.ParameterizedJob & Queue.Task,RunT extends Run<JobT,RunT> & Queue.Executable> extends Object
Job
to make use of ParametersDefinitionProperty
and be scheduled in various ways.
Stateless so there is no need to keep an instance of it in a field.Modifier and Type | Class and Description |
---|---|
static interface |
ParameterizedJobMixIn.ParameterizedJob
Marker for job using this mixin.
|
Constructor and Description |
---|
ParameterizedJobMixIn() |
Modifier and Type | Method and Description |
---|---|
protected abstract JobT |
asJob() |
void |
doBuild(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
TimeDuration delay)
Schedules a new build command.
|
void |
doBuildWithParameters(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
TimeDuration delay)
Supports build trigger with parameters via an HTTP GET or POST.
|
void |
doCancelQueue(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Cancels a scheduled build.
|
SearchIndexBuilder |
extendSearchIndex(SearchIndexBuilder sib)
Use from a
Job.makeSearchIndex() override. |
static CauseAction |
getBuildCause(ParameterizedJobMixIn.ParameterizedJob job,
org.kohsuke.stapler.StaplerRequest req)
Computes the build cause, using RemoteCause or UserCause as appropriate.
|
String |
getBuildNowText()
Suggested implementation of
ParameterizedJobMixIn.ParameterizedJob.getBuildNowText() . |
boolean |
isParameterized()
A job should define a method of the same signature for use from
BuildButtonColumn . |
boolean |
scheduleBuild() |
boolean |
scheduleBuild(Cause c) |
boolean |
scheduleBuild(int quietPeriod) |
boolean |
scheduleBuild(int quietPeriod,
Cause c) |
QueueTaskFuture<RunT> |
scheduleBuild2(int quietPeriod,
Action... actions)
Convenience method to schedule a build with the ability to wait for its result.
|
protected abstract JobT asJob()
public final boolean scheduleBuild()
BuildableItem.scheduleBuild()
public final boolean scheduleBuild(Cause c)
BuildableItem.scheduleBuild(Cause)
public final boolean scheduleBuild(int quietPeriod)
BuildableItem.scheduleBuild(int)
public final boolean scheduleBuild(int quietPeriod, Cause c)
BuildableItem.scheduleBuild(int, Cause)
@CheckForNull public final QueueTaskFuture<RunT> scheduleBuild2(int quietPeriod, Action... actions)
JenkinsRule.assertBuildStatusSuccess
).quietPeriod
- seconds to wait before starting (normally 0)actions
- various actions to associate with the scheduling, such as ParametersAction
or CauseAction
public final boolean isParameterized()
BuildButtonColumn
.public final void doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public final void doBuildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException
IOException
javax.servlet.ServletException
public final void doCancelQueue(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
RequirePOST
but with the same signature and delegate to this.IOException
javax.servlet.ServletException
public final SearchIndexBuilder extendSearchIndex(SearchIndexBuilder sib)
Job.makeSearchIndex()
override.sib
- the super value@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) public static final CauseAction getBuildCause(ParameterizedJobMixIn.ParameterizedJob job, org.kohsuke.stapler.StaplerRequest req)
public final String getBuildNowText()
ParameterizedJobMixIn.ParameterizedJob.getBuildNowText()
.Copyright © 2014. All rights reserved.