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,FullyNamed,FullyNamedModelObject,ITask,Item,ModelObject,Named,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.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault RunTCreates an object which performs the actual execution of the task.default voiddoBuild(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, TimeDuration delay) Schedules a new build command.default voiddoBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay) Deprecated.default voiddoBuildWithParameters(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp, TimeDuration delay) Supports build trigger with parameters via an HTTP GET or POST.default voiddoBuildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay) default voiddoCancelQueue(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Cancels a scheduled build.default org.kohsuke.stapler.HttpResponsedefault org.kohsuke.stapler.HttpResponsedoEnable()default voiddoPolling(org.kohsuke.stapler.StaplerRequest2 req, org.kohsuke.stapler.StaplerResponse2 rsp) Schedules a new SCM polling command.default StringText to display for a build button.default ParameterizedJobMixIn<JobT, RunT> Creates a helper object.default intQuiet period for the job.default booleandefault booleandefault booleanFor use fromBuildButtonColumn.default voidmakeDisabled(boolean b) Marks the build as disabled.resolveForCLI(String name) Used for CLI binding.default booleanscheduleBuild(int quietPeriod, Cause c) default booleandefault 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 voidsetDisabled(boolean disabled) default booleanSpecifies whether this project may be disabled by the user.Methods inherited from interface hudson.security.AccessControlled
checkAnyPermission, checkPermission, getACL, hasAnyPermission, hasPermission, hasPermission, hasPermission2Methods inherited from interface hudson.model.BuildableItem
scheduleBuild, scheduleBuildMethods inherited from interface jenkins.model.queue.ITask
getFullDisplayName, hasAbortPermission, hasReadPermissionMethods inherited from interface hudson.model.Item
delete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getSearchGroup, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, onLoad, saveMethods inherited from interface hudson.model.PersistenceRoot
getRootDirMethods inherited from interface hudson.model.Queue.Task
checkAbortPermission, getAffinityKey, getCauseOfBlockage, getDefaultAuthentication, getDefaultAuthentication, getDefaultAuthentication2, getDefaultAuthentication2, getName, getSubTasks, getUrl, getWhyBlocked, isBuildBlocked, isConcurrentBuildMethods inherited from interface hudson.model.ResourceActivity
getResourceListMethods inherited from interface hudson.search.SearchableModelObject
getSearchMethods inherited from interface hudson.search.SearchItem
getSearchIcon, getSearchIndex, getSearchName, getSearchUrlMethods inherited from interface hudson.model.queue.SubTask
getAssignedLabel, getEstimatedDuration, getLastBuiltOn, getOwnerExecutable, getOwnerTask, getSameNodeConstraintMethods 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:
scheduleBuildin interfaceBuildableItem
-
scheduleBuild
- Specified by:
scheduleBuildin 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 asParametersActionorCauseAction- 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:
IOExceptionjakarta.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:
IOExceptionjavax.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:
IOExceptionjakarta.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:
IOExceptionjavax.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:
IOExceptionjakarta.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:
IOExceptionjakarta.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:SubTaskCreates an object which performs the actual execution of the task.- Specified by:
createExecutablein interfaceSubTask- Returns:
- executable to be launched or null if the executable cannot be
created (e.g.
AbstractProjectis disabled) - Throws:
IOException- executable cannot be created
-
isBuildable
default boolean isBuildable()
-
doBuild(StaplerRequest2, StaplerResponse2, TimeDuration)