public abstract class ParameterizedJobMixIn<JobT extends Job<JobT,RunT> & ParameterizedJobMixIn.ParameterizedJob<JobT,RunT> & 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.
Besides implementing ParameterizedJobMixIn.ParameterizedJob
, you should
Job.makeSearchIndex()
to call extendSearchIndex(hudson.search.SearchIndexBuilder)
AbstractItem.performDelete()
to call ParameterizedJobMixIn.ParameterizedJob.makeDisabled(boolean)
Job.getIconColor()
to call ParameterizedJobMixIn.ParameterizedJob.isDisabled()
<p:config-disableBuild/>
<p:makeDisabled/>
Modifier and Type | Class and Description |
---|---|
static interface |
ParameterizedJobMixIn.ParameterizedJob<JobT extends Job<JobT,RunT> & ParameterizedJobMixIn.ParameterizedJob<JobT,RunT> & Queue.Task,RunT extends Run<JobT,RunT> & Queue.Executable>
Marker for job using this mixin, and default implementations of many methods.
|
Modifier and Type | Field and Description |
---|---|
static AlternativeUiTextProvider.Message<ParameterizedJobMixIn.ParameterizedJob> |
BUILD_NOW_TEXT
Allows customization of the human-readable display name to be rendered in the Build Now link.
|
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)
|
void |
doBuildWithParameters(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp,
TimeDuration delay)
|
void |
doCancelQueue(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
|
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() . |
static <T extends Trigger<?>> |
getTrigger(Job<?,?> job,
Class<T> clazz)
Checks for the existence of a specific trigger on a job.
|
boolean |
isParameterized()
Standard implementation of
ParameterizedJobMixIn.ParameterizedJob.isParameterized() . |
boolean |
scheduleBuild() |
boolean |
scheduleBuild(Cause c) |
boolean |
scheduleBuild(int quietPeriod) |
boolean |
scheduleBuild(int quietPeriod,
Cause c) |
QueueTaskFuture<RunT> |
scheduleBuild2(int quietPeriod,
Action... actions)
Standard implementation of
ParameterizedJobMixIn.ParameterizedJob.scheduleBuild2(int, hudson.model.Action...) . |
static Queue.Item |
scheduleBuild2(Job<?,?> job,
int quietPeriod,
Action... actions)
Convenience method to schedule a build.
|
public static final AlternativeUiTextProvider.Message<ParameterizedJobMixIn.ParameterizedJob> BUILD_NOW_TEXT
getBuildNowText()
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)
ParameterizedJobMixIn.ParameterizedJob.scheduleBuild2(int, hudson.model.Action...)
.@CheckForNull public static Queue.Item scheduleBuild2(Job<?,?> job, int quietPeriod, Action... actions)
Trigger
implementations, for example.
If you need to wait for the build to start (or finish), use Queue.Item#getFuture
.job
- a job which might be schedulablequietPeriod
- seconds to wait before starting; use -1
to use the job’s default settingsactions
- various actions to associate with the scheduling, such as ParametersAction
or CauseAction
Queue.QueueDecisionHandler
rejected it), or if job
is not a ParameterizedJobMixIn.ParameterizedJob
or it is not Job.isBuildable()
)public final boolean isParameterized()
ParameterizedJobMixIn.ParameterizedJob.isParameterized()
.public final void doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException
ParameterizedJobMixIn.ParameterizedJob.doBuild(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse, jenkins.util.TimeDuration)
.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
ParameterizedJobMixIn.ParameterizedJob.doBuildWithParameters(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse, jenkins.util.TimeDuration)
.IOException
javax.servlet.ServletException
public final void doCancelQueue(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
ParameterizedJobMixIn.ParameterizedJob.doCancelQueue(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse)
.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()
.@CheckForNull public static <T extends Trigger<?>> T getTrigger(Job<?,?> job, Class<T> clazz)
T
- a trigger typejob
- a jobclazz
- the type of the triggerjob
is not a ParameterizedJobMixIn.ParameterizedJob
Copyright © 2004–2018. All rights reserved.