Package jenkins.model
Interface ParameterizedJobMixIn.ParameterizedJob<JobT extends Job<JobT,RunT> & ParameterizedJobMixIn.ParameterizedJob<JobT,RunT> & Queue.Task,RunT extends Run<JobT,RunT> & Queue.Executable>
- All Superinterfaces:
AccessControlled
,BuildableItem
,ITask
,Item
,ModelObject
,OnMaster
,PersistenceRoot
,Queue.Task
,ResourceActivity
,Saveable
,SearchableModelObject
,SearchItem
,SubTask
,TriggeredItem
- All Known Implementing Classes:
AbstractProject
,FreeStyleProject
,Project
- Enclosing class:
- ParameterizedJobMixIn<JobT extends Job<JobT,
RunT> & ParameterizedJobMixIn.ParameterizedJob<JobT, RunT> & Queue.Task, RunT extends Run<JobT, RunT> & Queue.Executable>
public static interface ParameterizedJobMixIn.ParameterizedJob<JobT extends Job<JobT,RunT> & ParameterizedJobMixIn.ParameterizedJob<JobT,RunT> & Queue.Task,RunT extends Run<JobT,RunT> & Queue.Executable>
extends BuildableItem, TriggeredItem
Marker for job using this mixin, and default implementations of many methods.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault RunT
Creates an object which performs the actual execution of the task.default void
doBuild
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, TimeDuration delay) Schedules a new build command.default void
doBuild
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay) Deprecated.default void
doBuildWithParameters
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, TimeDuration delay) Supports build trigger with parameters via an HTTP GET or POST.default void
doBuildWithParameters
(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay) default void
doCancelQueue
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Cancels a scheduled build.default org.kohsuke.stapler.HttpResponse
default org.kohsuke.stapler.HttpResponse
doEnable()
default void
doPolling
(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Schedules a new SCM polling command.default String
Text to display for a build button.default ParameterizedJobMixIn<JobT,
RunT> Creates a helper object.default int
Quiet period for the job.default boolean
default boolean
default boolean
For use fromBuildButtonColumn
.default void
makeDisabled
(boolean b) Marks the build as disabled.resolveForCLI
(String name) Used for CLI binding.default boolean
scheduleBuild
(int quietPeriod, Cause c) default boolean
default QueueTaskFuture<RunT>
scheduleBuild2
(int quietPeriod, Action... actions) Provides a standard implementation ofSCMTriggerItem.scheduleBuild2(int, hudson.model.Action...)
to schedule a build with the ability to wait for its result.default void
setDisabled
(boolean disabled) default boolean
Specifies whether this project may be disabled by the user.Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2
Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuild
Methods inherited from interface jenkins.model.queue.ITask
hasAbortPermission, hasReadPermission
Methods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, onLoad, save
Methods inherited from interface hudson.model.PersistenceRoot
getRootDir
Methods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getAffinityKey, getCauseOfBlockage, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getFullDisplayName, getName, getSubTasks, getUrl, getWhyBlocked, isBuildBlocked, isConcurrentBuild
Methods inherited from interface hudson.model.ResourceActivity
getDisplayName, getResourceList
Methods inherited from interface hudson.search.SearchableModelObject
getSearch
Methods inherited from interface hudson.search.SearchItem
getSearchIndex, getSearchName, getSearchUrl
Methods inherited from interface hudson.model.queue.SubTask
getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerExecutable, getOwnerTask, getSameNodeConstraint
Methods inherited from interface jenkins.triggers.TriggeredItem
getTriggers
-
Method Details
-
resolveForCLI
@Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @CLIResolver static ParameterizedJobMixIn.ParameterizedJob resolveForCLI(String name) throws org.kohsuke.args4j.CmdLineException Used for CLI binding.- Throws:
org.kohsuke.args4j.CmdLineException
-
getParameterizedJobMixIn
Creates a helper object. (Would have been done entirely as an interface with default methods had this been designed for Java 8.) -
getAuthToken
-
getQuietPeriod
default int getQuietPeriod()Quiet period for the job.- Returns:
- by default,
Jenkins.getQuietPeriod()
-
getBuildNowText
Text to display for a build button. UsesParameterizedJobMixIn.BUILD_NOW_TEXT
.- See Also:
-
scheduleBuild
- Specified by:
scheduleBuild
in interfaceBuildableItem
-
scheduleBuild
- Specified by:
scheduleBuild
in interfaceBuildableItem
-
scheduleBuild2
Provides a standard implementation ofSCMTriggerItem.scheduleBuild2(int, hudson.model.Action...)
to schedule a build with the ability to wait for its result. That job method is often used during functional tests (JenkinsRule.assertBuildStatusSuccess
).- Parameters:
quietPeriod
- seconds to wait before starting (normally 0)actions
- various actions to associate with the scheduling, such asParametersAction
orCauseAction
- Returns:
- a handle by which you may wait for the build to complete (or just start); or null if the build was not actually scheduled for some reason
-
doBuild
default void doBuild(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter TimeDuration delay) throws IOException, jakarta.servlet.ServletException Schedules a new build command.- Throws:
IOException
jakarta.servlet.ServletException
- See Also:
-
doBuild
@Deprecated @StaplerNotDispatchable default void doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException Deprecated.- Throws:
IOException
javax.servlet.ServletException
-
doBuildWithParameters
default void doBuildWithParameters(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, @QueryParameter TimeDuration delay) throws IOException, jakarta.servlet.ServletException Supports build trigger with parameters via an HTTP GET or POST. Currently only String parameters are supported.- Throws:
IOException
jakarta.servlet.ServletException
- See Also:
-
doBuildWithParameters
@Deprecated @StaplerNotDispatchable default void doBuildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException - Throws:
IOException
javax.servlet.ServletException
-
doCancelQueue
default void doCancelQueue(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Cancels a scheduled build.- Throws:
IOException
jakarta.servlet.ServletException
- See Also:
-
doPolling
default void doPolling(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) throws IOException, jakarta.servlet.ServletException Schedules a new SCM polling command.- Throws:
IOException
jakarta.servlet.ServletException
-
isParameterized
default boolean isParameterized()For use fromBuildButtonColumn
.- See Also:
-
isDisabled
default boolean isDisabled() -
setDisabled
@Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class) default void setDisabled(boolean disabled) -
supportsMakeDisabled
default boolean supportsMakeDisabled()Specifies whether this project may be disabled by the user.- Returns:
- true if the GUI should allow
doDisable()
and the like
-
makeDisabled
Marks the build as disabled. The method will ignore the disable command ifsupportsMakeDisabled()
returns false. The enable command will be executed in any case.- Parameters:
b
- true - disable, false - enable- Throws:
IOException
-
doDisable
@CLIMethod(name="disable-job") default org.kohsuke.stapler.HttpResponse doDisable() throws IOException- Throws:
IOException
-
doEnable
@CLIMethod(name="enable-job") default org.kohsuke.stapler.HttpResponse doEnable() throws IOException- Throws:
IOException
-
createExecutable
Description copied from interface:SubTask
Creates an object which performs the actual execution of the task.- Specified by:
createExecutable
in interfaceSubTask
- Returns:
- executable to be launched or null if the executable cannot be
created (e.g.
AbstractProject
is disabled) - Throws:
IOException
- executable cannot be created
-
isBuildable
default boolean isBuildable()
-
doBuild(StaplerRequest2, StaplerResponse2, TimeDuration)