P - the project typeR - the run typepublic abstract class MultiBranchProject<P extends hudson.model.AbstractProject<P,R> & hudson.model.TopLevelItem,R extends hudson.model.AbstractBuild<P,R>>
extends hudson.model.AbstractItem
implements hudson.model.TopLevelItem, hudson.model.ItemGroup<P>, hudson.model.Saveable, hudson.model.ViewGroup, org.kohsuke.stapler.StaplerFallback, jenkins.scm.api.SCMSourceOwner, hudson.model.BuildableItem, hudson.model.Queue.FlyweightTask
| Modifier and Type | Class and Description |
|---|---|
static class |
MultiBranchProject.BranchIndexing<P extends hudson.model.AbstractProject<P,R> & hudson.model.TopLevelItem,R extends hudson.model.AbstractBuild<P,R>>
Represents the branch indexing job.
|
static class |
MultiBranchProject.Cron
Runs every minute to check
TimerTrigger and schedules build. |
static class |
MultiBranchProject.DeadBranchCleanupThread
Background thread to tidy up dead branches.
|
static class |
MultiBranchProject.ThrottleIndexingQueueTaskDispatcher
We need to be able to limit concurrent indexing.
|
| Modifier | Constructor and Description |
|---|---|
protected |
MultiBranchProject(hudson.model.ItemGroup parent,
String name)
Constructor, mandated by
TopLevelItem. |
| Modifier and Type | Method and Description |
|---|---|
void |
addTrigger(hudson.triggers.Trigger<?> trigger)
Adds a new
Trigger to this MultiBranchProject if not active yet. |
void |
addView(hudson.model.View v) |
boolean |
canDelete(P branch)
Returns
true iff this branch can be deleted by the user. |
boolean |
canDelete(hudson.model.View view) |
void |
checkAbortPermission() |
hudson.model.Queue.Executable |
createExecutable() |
void |
deleteView(hudson.model.View view) |
org.kohsuke.stapler.HttpResponse |
doBuild(jenkins.util.TimeDuration delay)
Handles a POST request to trigger indexing.
|
void |
doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Accepts submission from the configuration page.
|
org.kohsuke.stapler.HttpResponse |
doIndexingSubmit(jenkins.util.TimeDuration delay)
Handles a POST request to trigger indexing.
|
Collection<? extends hudson.model.Job> |
getAllJobs() |
hudson.model.Label |
getAssignedLabel() |
P |
getBranch(String name)
Returns the named branch job or
null if no such branch exists. |
File |
getBranchesDir()
Returns the directory that all branches are stored in.
|
BranchPropertyStrategy |
getBranchPropertyStrategy(jenkins.scm.api.SCMSource source)
Returns the
BranchPropertyStrategy for a specific SCMSource. |
hudson.model.HealthReport |
getBuildHealth()
Get the current health report for a folder.
|
List<hudson.model.HealthReport> |
getBuildHealthReports()
Get the current health reports for a job.
|
hudson.model.queue.CauseOfBlockage |
getCauseOfBlockage() |
DeadBranchStrategy |
getDeadBranchStrategy()
Returns the special dead branch source.
|
org.acegisecurity.Authentication |
getDefaultAuthentication()
Jenkins 1.520+ expects this method.
|
MultiBranchProjectDescriptor |
getDescriptor() |
long |
getEstimatedDuration() |
hudson.model.BallColor |
getIconColor()
Used as the color of the status ball for the project.
|
MultiBranchProject.BranchIndexing<P,R> |
getIndexing()
Returns the current/most recent indexing details.
|
File |
getIndexingDir()
Returns the directory that branch indexing is stored in.
|
P |
getItem(String name)
Returns the named child job or
null if no such job exists. |
hudson.model.ItemGroup<? extends hudson.model.TopLevelItem> |
getItemGroup() |
Collection<P> |
getItems()
Returns all the child jobs.
|
hudson.model.Node |
getLastBuiltOn() |
hudson.model.Queue.Task |
getOwnerTask() |
hudson.model.View |
getPrimaryView() |
BranchProjectFactory<P,R> |
getProjectFactory()
Returns the
BranchProjectFactory. |
hudson.model.ResourceList |
getResourceList() |
File |
getRootDirFor(P child) |
Object |
getSameNodeConstraint() |
jenkins.scm.api.SCMSource |
getSCMSource(String sourceId) |
jenkins.scm.api.SCMSourceCriteria |
getSCMSourceCriteria(jenkins.scm.api.SCMSource source) |
List<jenkins.scm.api.SCMSource> |
getSCMSources() |
List<BranchSource> |
getSources()
The sources of branches.
|
hudson.model.View |
getStaplerFallback()
Fallback to the primary view.
|
Collection<? extends hudson.model.queue.SubTask> |
getSubTasks() |
<T extends hudson.triggers.Trigger> |
getTrigger(Class<T> clazz)
Gets the specific trigger, or null if the property is not configured for this job.
|
Map<hudson.triggers.TriggerDescriptor,hudson.triggers.Trigger> |
getTriggers()
|
String |
getUrlChildPrefix() |
hudson.model.View |
getView(String name) |
List<hudson.model.Action> |
getViewActions() |
Collection<hudson.model.View> |
getViews() |
hudson.views.ViewsTabBar |
getViewsTabBar() |
protected hudson.model.View |
getWelcomeView()
Creates a place holder view when there's no active branch indexed.
|
String |
getWhyBlocked() |
boolean |
hasAbortPermission() |
boolean |
isBuildable()
Returns
true if and only if this project can be indexed. |
boolean |
isBuildBlocked() |
boolean |
isConcurrentBuild() |
boolean |
isConfigurable()
Used in sidepanel.jelly to decide whether to display
the config/delete/build links.
|
Branch |
newBranch(jenkins.scm.api.SCMSource source,
jenkins.scm.api.SCMHead head)
|
protected abstract BranchProjectFactory<P,R> |
newProjectFactory()
Creates a new instance of the default project factory to be used for a new instance of the project type.
|
void |
onDeleted(P item) |
void |
onLoad(hudson.model.ItemGroup<? extends hudson.model.Item> parent,
String name) |
void |
onRenamed(P item,
String oldName,
String newName) |
void |
onSCMSourceUpdated(jenkins.scm.api.SCMSource source) |
void |
onViewRenamed(hudson.model.View view,
String oldName,
String newName) |
static String |
rawDecode(String s)
Inverse function of
Util.rawEncode(String) |
void |
removeTrigger(hudson.triggers.TriggerDescriptor trigger)
Removes a new
Trigger to this MultiBranchProject if not active yet. |
boolean |
scheduleBuild() |
boolean |
scheduleBuild(hudson.model.Cause c) |
boolean |
scheduleBuild(int quietPeriod) |
boolean |
scheduleBuild(int quietPeriod,
hudson.model.Cause c) |
boolean |
scheduleBuild(int quietPeriod,
hudson.model.Cause c,
hudson.model.Action... actions)
Schedules a build.
|
hudson.model.queue.QueueTaskFuture<R> |
scheduleBuild2(int quietPeriod,
hudson.model.Cause c,
hudson.model.Action... actions)
Schedules a build of this project, and returns a
Future object
to wait for the completion of the build. |
hudson.model.queue.QueueTaskFuture<R> |
scheduleBuild2(int quietPeriod,
hudson.model.Cause c,
Collection<? extends hudson.model.Action> actions)
Schedules a build of this project, and returns a
Future object
to wait for the completion of the build. |
void |
setProjectFactory(BranchProjectFactory<P,R> projectFactory)
Sets the
BranchProjectFactory. |
protected void |
submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Derived class can override this to perform additional config submission
work.
|
checkPermission, delete, delete, doConfigDotXml, doDoDelete, doSetName, doSubmitDescription, getAbsoluteUrl, getACL, getApi, getConfigFile, getDescription, getDescriptorByName, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getPronoun, getRelativeNameFrom, getRelativeNameFrom, getRootDir, getSearchName, getSearchUrl, getShortUrl, getUrl, hasPermission, onCopiedFrom, onCreatedFromScratch, performDelete, renameTo, resolveForCLI, save, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXmladdAction, doContextMenu, getAction, getAction, getActions, getActions, getDynamicgetSearch, getSearchIndex, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdelete, getAbsoluteUrl, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, savegetSearchIndex, getSearchName, getSearchUrlprotected MultiBranchProject(hudson.model.ItemGroup parent,
String name)
TopLevelItem.parent - the parent of this multibranch job.name - the name of the multibranch job.public void onLoad(hudson.model.ItemGroup<? extends hudson.model.Item> parent,
String name)
throws IOException
onLoad in interface hudson.model.ItemonLoad in class hudson.model.AbstractItemIOException@NonNull public BranchProjectFactory<P,R> getProjectFactory()
BranchProjectFactory. ˜BranchProjectFactory.public void setProjectFactory(BranchProjectFactory<P,R> projectFactory)
BranchProjectFactory.projectFactory - the new BranchProjectFactory.@NonNull protected abstract BranchProjectFactory<P,R> newProjectFactory()
BranchProjectFactory.@NonNull public List<BranchSource> getSources()
@NonNull public List<jenkins.scm.api.SCMSource> getSCMSources()
getSCMSources in interface jenkins.scm.api.SCMSourceOwnerpublic void addTrigger(hudson.triggers.Trigger<?> trigger)
throws IOException
Trigger to this MultiBranchProject if not active yet.IOExceptionpublic void removeTrigger(hudson.triggers.TriggerDescriptor trigger)
throws IOException
Trigger to this MultiBranchProject if not active yet.IOExceptionpublic Map<hudson.triggers.TriggerDescriptor,hudson.triggers.Trigger> getTriggers()
Trigger as a Map keyed by TriggerDescriptor.public <T extends hudson.triggers.Trigger> T getTrigger(Class<T> clazz)
@CheckForNull
public jenkins.scm.api.SCMSource getSCMSource(@CheckForNull
String sourceId)
getSCMSource in interface jenkins.scm.api.SCMSourceOwner@CheckForNull public BranchPropertyStrategy getBranchPropertyStrategy(@NonNull jenkins.scm.api.SCMSource source)
BranchPropertyStrategy for a specific SCMSource.source - the specific SCMSource.BranchPropertyStrategy to use.@NonNull public Branch newBranch(@NonNull jenkins.scm.api.SCMSource source, @NonNull jenkins.scm.api.SCMHead head)
source - the SCMSourcehead - the SCMHead.Branch@CheckForNull
public jenkins.scm.api.SCMSourceCriteria getSCMSourceCriteria(@NonNull
jenkins.scm.api.SCMSource source)
getSCMSourceCriteria in interface jenkins.scm.api.SCMSourceOwnerpublic void onSCMSourceUpdated(@NonNull
jenkins.scm.api.SCMSource source)
onSCMSourceUpdated in interface jenkins.scm.api.SCMSourceOwner@NonNull public DeadBranchStrategy getDeadBranchStrategy()
public boolean canDelete(P branch)
true iff this branch can be deleted by the user.branch - the branch.true iff this branch is one of the dead branches.@NonNull public Collection<P> getItems()
@CheckForNull public P getItem(String name)
null if no such job exists.@CheckForNull public P getBranch(String name)
null if no such branch exists.name - the name of the branchnull if no such branch exists.public boolean isConfigurable()
@NonNull public String getUrlChildPrefix()
@NonNull public File getBranchesDir()
@NonNull public File getIndexingDir()
public void onRenamed(P item, String oldName, String newName) throws IOException
onRenamed in interface hudson.model.ItemGroup<P extends hudson.model.AbstractProject<P,R> & hudson.model.TopLevelItem>IOExceptionpublic void onDeleted(P item) throws IOException
onDeleted in interface hudson.model.ItemGroup<P extends hudson.model.AbstractProject<P,R> & hudson.model.TopLevelItem>IOException@NonNull public Collection<? extends hudson.model.Job> getAllJobs()
getAllJobs in interface hudson.model.ItemgetAllJobs in class hudson.model.AbstractItem@NonNull public MultiBranchProjectDescriptor getDescriptor()
getDescriptor in interface hudson.model.Describable<hudson.model.TopLevelItem>getDescriptor in interface hudson.model.TopLevelItempublic MultiBranchProject.BranchIndexing<P,R> getIndexing()
public org.kohsuke.stapler.HttpResponse doBuild(@QueryParameter
jenkins.util.TimeDuration delay)
throws IOException,
javax.servlet.ServletException
IOException - if things go wrong.javax.servlet.ServletException - if things go wrong.public org.kohsuke.stapler.HttpResponse doIndexingSubmit(@QueryParameter
jenkins.util.TimeDuration delay)
throws IOException,
javax.servlet.ServletException
IOException - if things go wrong.javax.servlet.ServletException - if things go wrong.public void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException,
hudson.model.Descriptor.FormException
req - request.rsp - response.IOException - if things go wrong.javax.servlet.ServletException - if things go wrong.hudson.model.Descriptor.FormExceptionprotected void submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException,
hudson.model.Descriptor.FormException
IOExceptionjavax.servlet.ServletExceptionhudson.model.Descriptor.FormException@NonNull public hudson.model.View getStaplerFallback()
getStaplerFallback in interface org.kohsuke.stapler.StaplerFallback@NonNull public hudson.model.ItemGroup<? extends hudson.model.TopLevelItem> getItemGroup()
getItemGroup in interface hudson.model.ViewGroup@NonNull public hudson.views.ViewsTabBar getViewsTabBar()
getViewsTabBar in interface hudson.model.ViewGroup@NonNull public List<hudson.model.Action> getViewActions()
getViewActions in interface hudson.model.ViewGrouppublic void addView(hudson.model.View v)
throws IOException
IOExceptionpublic boolean canDelete(hudson.model.View view)
canDelete in interface hudson.model.ViewGrouppublic void deleteView(hudson.model.View view)
throws IOException
deleteView in interface hudson.model.ViewGroupIOException@Exported @NonNull public hudson.model.View getPrimaryView()
getPrimaryView in interface hudson.model.ViewGroupprotected hudson.model.View getWelcomeView()
@CheckForNull public hudson.model.View getView(String name)
getView in interface hudson.model.ViewGroup@Exported @NonNull public Collection<hudson.model.View> getViews()
getViews in interface hudson.model.ViewGrouppublic void onViewRenamed(hudson.model.View view,
String oldName,
String newName)
onViewRenamed in interface hudson.model.ViewGroup@Exported(visibility=2,
name="color")
public hudson.model.BallColor getIconColor()
public hudson.model.HealthReport getBuildHealth()
@Exported(name="healthReport") public List<hudson.model.HealthReport> getBuildHealthReports()
public boolean isBuildable()
true if and only if this project can be indexed.true if and only if this project can be indexed.public boolean scheduleBuild()
scheduleBuild in interface hudson.model.BuildableItempublic boolean scheduleBuild(int quietPeriod)
scheduleBuild in interface hudson.model.BuildableItempublic boolean scheduleBuild(hudson.model.Cause c)
scheduleBuild in interface hudson.model.BuildableItempublic boolean scheduleBuild(int quietPeriod,
hudson.model.Cause c)
scheduleBuild in interface hudson.model.BuildableItempublic boolean scheduleBuild(int quietPeriod,
hudson.model.Cause c,
hudson.model.Action... actions)
quietPeriod - the quiet period to observerc - the cause for this build which should be recordedactions - a list of Actions that will be added to the build@WithBridgeMethods(value=java.util.concurrent.Future.class) @NonNull public hudson.model.queue.QueueTaskFuture<R> scheduleBuild2(int quietPeriod, hudson.model.Cause c, hudson.model.Action... actions)
Future object
to wait for the completion of the build.actions - For the convenience of the caller, this array can contain null,
and those will be silently ignored.public void checkAbortPermission()
checkAbortPermission in interface hudson.model.Queue.Taskpublic boolean isBuildBlocked()
isBuildBlocked in interface hudson.model.Queue.Task@CheckForNull public String getWhyBlocked()
getWhyBlocked in interface hudson.model.Queue.Task@CheckForNull public hudson.model.queue.CauseOfBlockage getCauseOfBlockage()
getCauseOfBlockage in interface hudson.model.Queue.Taskpublic boolean hasAbortPermission()
hasAbortPermission in interface hudson.model.Queue.Taskpublic boolean isConcurrentBuild()
isConcurrentBuild in interface hudson.model.Queue.Taskpublic Collection<? extends hudson.model.queue.SubTask> getSubTasks()
getSubTasks in interface hudson.model.Queue.Taskpublic hudson.model.Label getAssignedLabel()
getAssignedLabel in interface hudson.model.queue.SubTaskpublic hudson.model.Node getLastBuiltOn()
getLastBuiltOn in interface hudson.model.queue.SubTaskpublic long getEstimatedDuration()
getEstimatedDuration in interface hudson.model.queue.SubTaskpublic hudson.model.Queue.Executable createExecutable()
throws IOException
createExecutable in interface hudson.model.queue.SubTaskIOExceptionpublic hudson.model.Queue.Task getOwnerTask()
getOwnerTask in interface hudson.model.queue.SubTaskpublic Object getSameNodeConstraint()
getSameNodeConstraint in interface hudson.model.queue.SubTaskpublic hudson.model.ResourceList getResourceList()
getResourceList in interface hudson.model.ResourceActivity@NonNull public org.acegisecurity.Authentication getDefaultAuthentication()
@WithBridgeMethods(value=java.util.concurrent.Future.class) public hudson.model.queue.QueueTaskFuture<R> scheduleBuild2(int quietPeriod, hudson.model.Cause c, Collection<? extends hudson.model.Action> actions)
Future object
to wait for the completion of the build.actions - For the convenience of the caller, this collection can contain null,
and those will be silently ignored.Copyright © 2004-2013. All Rights Reserved.