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
,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.
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default RunT
createExecutable()
Creates an object which performs the actual execution of the task.default void
doBuild(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, TimeDuration delay)
Schedules a new build command.default 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.default void
doCancelQueue(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Cancels a scheduled build.default org.kohsuke.stapler.HttpResponse
doDisable()
default org.kohsuke.stapler.HttpResponse
doEnable()
default void
doPolling(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp)
Schedules a new SCM polling command.BuildAuthorizationToken
getAuthToken()
default String
getBuildNowText()
Text to display for a build button.default ParameterizedJobMixIn<JobT,RunT>
getParameterizedJobMixIn()
Creates a helper object.default int
getQuietPeriod()
Quiet period for the job.default boolean
isBuildable()
default boolean
isDisabled()
default boolean
isParameterized()
For use fromBuildButtonColumn
.default void
makeDisabled(boolean b)
Marks the build as disabled.static ParameterizedJobMixIn.ParameterizedJob
resolveForCLI(String name)
Used for CLI binding.default boolean
scheduleBuild(int quietPeriod, Cause c)
default boolean
scheduleBuild(Cause c)
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
supportsMakeDisabled()
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 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, hasAbortPermission, 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 Detail
-
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
default ParameterizedJobMixIn<JobT,RunT> getParameterizedJobMixIn()
Creates a helper object. (Would have been done entirely as an interface with default methods had this been designed for Java 8.)
-
getAuthToken
@CheckForNull BuildAuthorizationToken getAuthToken()
-
getQuietPeriod
default int getQuietPeriod()
Quiet period for the job.- Returns:
- by default,
Jenkins.getQuietPeriod()
-
getBuildNowText
default String getBuildNowText()
Text to display for a build button. UsesParameterizedJobMixIn.BUILD_NOW_TEXT
.- See Also:
ParameterizedJobMixIn.getBuildNowText()
-
scheduleBuild
default boolean scheduleBuild(Cause c)
- Specified by:
scheduleBuild
in interfaceBuildableItem
-
scheduleBuild
default boolean scheduleBuild(int quietPeriod, Cause c)
- Specified by:
scheduleBuild
in interfaceBuildableItem
-
scheduleBuild2
@CheckForNull 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. 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.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException
Schedules a new build command.- Throws:
IOException
javax.servlet.ServletException
- See Also:
ParameterizedJobMixIn.doBuild(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse, jenkins.util.TimeDuration)
-
doBuildWithParameters
default void doBuildWithParameters(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp, @QueryParameter TimeDuration delay) throws IOException, javax.servlet.ServletException
Supports build trigger with parameters via an HTTP GET or POST. Currently only String parameters are supported.- Throws:
IOException
javax.servlet.ServletException
- See Also:
ParameterizedJobMixIn.doBuildWithParameters(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse, jenkins.util.TimeDuration)
-
doCancelQueue
default void doCancelQueue(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Cancels a scheduled build.- Throws:
IOException
javax.servlet.ServletException
- See Also:
ParameterizedJobMixIn.doCancelQueue(org.kohsuke.stapler.StaplerRequest, org.kohsuke.stapler.StaplerResponse)
-
doPolling
default void doPolling(org.kohsuke.stapler.StaplerRequest req, org.kohsuke.stapler.StaplerResponse rsp) throws IOException, javax.servlet.ServletException
Schedules a new SCM polling command.- Throws:
IOException
javax.servlet.ServletException
-
isParameterized
default boolean isParameterized()
For use fromBuildButtonColumn
.- See Also:
ParameterizedJobMixIn.isParameterized()
-
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
default void makeDisabled(boolean b) throws IOException
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, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
doEnable
@CLIMethod(name="enable-job") default org.kohsuke.stapler.HttpResponse doEnable() throws IOException, javax.servlet.ServletException
- Throws:
IOException
javax.servlet.ServletException
-
createExecutable
default RunT createExecutable() throws IOException
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()
-
-