public abstract class AbstractMultiBranchProject<P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem,B extends hudson.model.AbstractBuild<P,B>>
extends hudson.model.AbstractProject<P,B>
implements hudson.model.TopLevelItem, hudson.model.ItemGroup<P>, hudson.model.ViewGroup, jenkins.scm.api.SCMSourceOwner
| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractMultiBranchProject.BranchProjectItemListener
Additional listener for normal changes to Items in the UI, used to
enforce state for multi-branch projects and their sub-projects.
|
static class |
AbstractMultiBranchProject.BranchProjectSaveListener
Additional listener for changes to Items via config.xml POST, used to
enforce state for multi-branch projects and their sub-projects.
|
hudson.model.AbstractProject.AbstractProjectDescriptor, hudson.model.AbstractProject.BecauseOfBuildInProgress, hudson.model.AbstractProject.BecauseOfDownstreamBuildInProgress, hudson.model.AbstractProject.BecauseOfUpstreamBuildInProgress| Modifier and Type | Field and Description |
|---|---|
protected String |
primaryView |
protected jenkins.scm.api.SCMSource |
scmSource |
protected P |
templateProject |
| Constructor and Description |
|---|
AbstractMultiBranchProject(hudson.model.ItemGroup parent,
String name) |
| Modifier and Type | Method and Description |
|---|---|
hudson.model.AbstractProject<?,?> |
asProject()
Used by SyncBranchesAction to load the sidepanel when the user is on the
Sync Branches Log page.
|
protected void |
buildDependencyGraph(hudson.model.DependencyGraph graph) |
boolean |
canDelete(hudson.model.View view) |
protected abstract P |
createNewSubProject(AbstractMultiBranchProject parent,
String branchName)
Defines how sub-projects should be created when provided the parent and
the branch name.
|
protected List<hudson.model.Action> |
createTransientActions() |
void |
deleteView(hudson.model.View view) |
void |
doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp) |
void |
doCreateView(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Stapler URL binding for creating views for our branch projects.
|
void |
doDoDelete(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Overrides the
AbstractProject implementation
because the user is not redirected to the parent properly for this
project type. |
void |
doSyncBranches(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Exposes a URI that allows the trigger of a branch sync.
|
hudson.util.FormValidation |
doViewExistsCheck(String value)
Stapler URL binding used by the newView page to check for existing
views.
|
static void |
enforceProjectStateOnUpdated(hudson.model.Item item)
Triggered by different listeners to enforce state for multi-branch
projects and their sub-projects.
|
P |
getBranch(String name)
Stapler URL binding for ${rootUrl}/job/${project}/branch/${branchProject}
|
File |
getBranchesDir()
Returns the "branches" directory inside the project directory.
|
List<hudson.model.HealthReport> |
getBuildHealthReports()
Get the current health reports for a job.
|
hudson.model.BallColor |
getIconColor()
Used as the color of the status ball for the project.
|
P |
getItem(String name) |
hudson.model.ItemGroup<? extends hudson.model.TopLevelItem> |
getItemGroup() |
Collection<P> |
getItems() |
hudson.model.View |
getPrimaryView() |
hudson.util.DescribableList<hudson.tasks.Publisher,hudson.model.Descriptor<hudson.tasks.Publisher>> |
getPublishersList() |
File |
getRootDirFor(P child) |
jenkins.scm.api.SCMSource |
getSCMSource()
Returns the project's only SCMSource.
|
jenkins.scm.api.SCMSource |
getSCMSource(String sourceId) |
jenkins.scm.api.SCMSourceCriteria |
getSCMSourceCriteria(jenkins.scm.api.SCMSource source) |
static List<jenkins.scm.api.SCMSourceDescriptor> |
getSCMSourceDescriptors(boolean onlyUserInstantiable)
Returns a list of SCMSourceDescriptors that we want to use for this
project type.
|
List<jenkins.scm.api.SCMSource> |
getSCMSources() |
protected Map<String,P> |
getSubProjects()
Retrieves the collection of sub-projects for this project.
|
String |
getSyncBranchesCron()
Used by Jelly to populate the Sync Branches Schedule field on the
configuration page.
|
P |
getTemplate()
Retrieves the template sub-project.
|
File |
getTemplateDir()
Returns the "template" directory inside the project directory.
|
String |
getUrlChildPrefix() |
hudson.model.View |
getView(String name) |
List<hudson.model.Action> |
getViewActions() |
static List<hudson.model.ViewDescriptor> |
getViewDescriptors()
Returns a list of ViewDescriptors that we want to use for this project
type.
|
Collection<hudson.model.View> |
getViews() |
hudson.views.ViewsTabBar |
getViewsTabBar() |
protected void |
init()
Common initialization that is invoked when either a new project is
created with the constructor
(ItemGroup, String) or when a project is loaded from disk with onLoad(ItemGroup, String). |
boolean |
isAllowAnonymousSync()
Gets whether anonymous sync is allowed from
${JOB_URL}/syncBranches |
boolean |
isBuildable() |
boolean |
isFingerprintConfigured() |
void |
makeDisabled(boolean b) |
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 |
setAllowAnonymousSync(boolean b)
Sets whether anonymous sync is allowed from
${JOB_URL}/syncBranches. |
protected void |
submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp) |
void |
syncBranches(hudson.model.TaskListener listener)
Synchronizes the available sub-projects by checking if the project is
disabled, then calling
_syncBranches(TaskListener) and logging
its exceptions to the listener. |
_getRuns, addProperty, addToList, addTrigger, blockBuildWhenDownstreamBuilding, blockBuildWhenUpstreamBuilding, buildDescribable, buildDescribable, checkAbortPermission, checkout, createExecutable, createHistoryWidget, disable, doBuild, doBuild, doBuildWithParameters, doBuildWithParameters, doCancelQueue, doCheckRetryCount, doChildrenContextMenu, doDisable, doDoWipeOutWorkspace, doEnable, doPolling, doRssChangelog, doWs, enable, findNearest, findNearest, getActions, getAssignedLabel, getAssignedLabelString, getAuthToken, getBuild, getBuildByNumber, getBuildClass, getBuildingDownstream, getBuildingUpstream, getBuildNowText, getBuildTriggerUpstreamProjects, getCauseOfBlockage, getCustomWorkspace, getDefaultAuthentication, getDelay, getDownstreamProjects, getEnvironment, getFirstBuild, getHasCustomQuietPeriod, getJDK, getLastBuild, getLastBuiltOn, getModuleRoot, getModuleRoots, getNearestBuild, getNearestOldBuild, getOwnerTask, getProminentActions, getPronoun, getQueueItem, getQuietPeriod, getRelationship, getRelevantLabels, getResourceActivities, getResourceList, getRootProject, getSameNodeConstraint, getScm, getScmCheckoutRetryCount, getScmCheckoutStrategy, getSomeBuildWithWorkspace, getSomeWorkspace, getSubTasks, getTransitiveDownstreamProjects, getTransitiveUpstreamProjects, getTrigger, getTriggers, getUpstreamProjects, getWhyBlocked, getWorkspace, getWorkspaceResource, hasAbortPermission, hasCustomScmCheckoutRetryCount, hasParticipant, isBuildBlocked, isConcurrentBuild, isConfigurable, isDisabled, isInQueue, isParameterized, loadBuild, makeSearchIndex, newBuild, onCreatedFromScratch, performDelete, poll, pollSCMChanges, removeFromList, removeRun, removeTrigger, renameTo, resolveForCLI, save, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild2, scheduleBuild2, scheduleBuild2, scheduleBuild2, schedulePolling, setAssignedLabel, setAssignedNode, setBlockBuildWhenDownstreamBuilding, setBlockBuildWhenUpstreamBuilding, setConcurrentBuild, setCustomWorkspace, setJDK, setQuietPeriod, setScm, setScmCheckoutStrategy, supportsMakeDisabled, triggers, updateTransientActionsassignBuildNumber, delete, doBuildStatus, doDescription, doDoRename, doRssAll, doRssFailed, getACL, getAllJobs, getAllProperties, getBuildDir, getBuildDiscarder, getBuildForCLI, getBuildHealth, getBuilds, getBuilds, getBuildsAsMap, getBuildsByTimestamp, getBuildStatusUrl, getBuildTimeGraph, getCharacteristicEnvVars, getDynamic, getEstimatedDuration, getEstimatedDurationCandidates, getLastBuildsOverThreshold, getLastCompletedBuild, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getLastUnstableBuild, getLastUnsuccessfulBuild, getLogRotator, getNewBuilds, getNextBuildNumber, getOverrides, getPermalinks, getProperties, getProperty, getProperty, getTimeline, getWidgets, isBuilding, isHoldOffBuildUntilSave, isKeepDependencies, isLogUpdated, isNameEditable, logRotate, onCopiedFrom, removeProperty, removeProperty, saveNextBuildNumber, setBuildDiscarder, setLogRotator, supportsLogRotator, updateNextBuildNumbercheckPermission, delete, doConfigDotXml, doSetName, doSubmitDescription, getAbsoluteUrl, getApi, getConfigFile, getDescription, getDescriptorByName, getDisplayName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFrom, getRelativeNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getUrl, hasPermission, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXmladdAction, doContextMenu, getAction, getAction, getActionsgetSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdelete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, saveprotected volatile jenkins.scm.api.SCMSource scmSource
protected transient P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem templateProject
protected volatile String primaryView
public AbstractMultiBranchProject(hudson.model.ItemGroup parent,
String name)
public void onLoad(hudson.model.ItemGroup<? extends hudson.model.Item> parent,
String name)
throws IOException
protected void init()
(ItemGroup, String) or when a project is loaded from disk with onLoad(ItemGroup, String).protected abstract P createNewSubProject(AbstractMultiBranchProject parent, String branchName)
parent - - thisbranchName - - branch namePpublic P getBranch(String name)
name - - Branch project namegetItem(String)public P getTemplate()
protected Map<String,P> getSubProjects()
public File getBranchesDir()
public File getTemplateDir()
public Collection<P> getItems()
public String getUrlChildPrefix()
public void onDeleted(P item)
public 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 public Collection<hudson.model.View> getViews()
getViews in interface hudson.model.ViewGrouppublic hudson.model.View getView(String name)
getView in interface hudson.model.ViewGroup@Exported public hudson.model.View getPrimaryView()
getPrimaryView in interface hudson.model.ViewGrouppublic void onViewRenamed(hudson.model.View view,
String oldName,
String newName)
onViewRenamed in interface hudson.model.ViewGrouppublic hudson.views.ViewsTabBar getViewsTabBar()
getViewsTabBar in interface hudson.model.ViewGrouppublic hudson.model.ItemGroup<? extends hudson.model.TopLevelItem> getItemGroup()
getItemGroup in interface hudson.model.ViewGrouppublic List<hudson.model.Action> getViewActions()
getViewActions in interface hudson.model.ViewGroup@NonNull public List<jenkins.scm.api.SCMSource> getSCMSources()
getSCMSources in interface jenkins.scm.api.SCMSourceOwner@CheckForNull
public jenkins.scm.api.SCMSource getSCMSource(@CheckForNull
String sourceId)
getSCMSource in interface jenkins.scm.api.SCMSourceOwnerpublic void onSCMSourceUpdated(@NonNull
jenkins.scm.api.SCMSource source)
onSCMSourceUpdated in interface jenkins.scm.api.SCMSourceOwner@CheckForNull
public jenkins.scm.api.SCMSourceCriteria getSCMSourceCriteria(@NonNull
jenkins.scm.api.SCMSource source)
getSCMSourceCriteria in interface jenkins.scm.api.SCMSourceOwnerpublic jenkins.scm.api.SCMSource getSCMSource()
public boolean isAllowAnonymousSync()
${JOB_URL}/syncBranchespublic void setAllowAnonymousSync(boolean b)
throws IOException
${JOB_URL}/syncBranches.b - - true/falseIOException - - if problems savingpublic boolean isBuildable()
public void doCreateView(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException,
ParseException,
hudson.model.Descriptor.FormException
req - - Stapler requestrsp - - Stapler responseIOException - - if problemsjavax.servlet.ServletException - - if problemsParseException - - if problemsDescriptor.FormException - - if problemspublic hudson.util.FormValidation doViewExistsCheck(@QueryParameter
String value)
value - - desired name of viewFormValidation.ok() or {@link
hudson.util.FormValidation#error(String)|public void doDoDelete(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
InterruptedException
AbstractProject implementation
because the user is not redirected to the parent properly for this
project type.
Inherited docs:
doDoDelete in class hudson.model.AbstractProject<P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem,B extends hudson.model.AbstractBuild<P,B>>req - - Stapler requestrsp - - Stapler responseIOException - - if problemsInterruptedException - - if problemspublic void doSyncBranches(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
InterruptedException
req - - Stapler requestrsp - - Stapler responseIOException - - if problemsInterruptedException - - if problemspublic void doConfigSubmit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws javax.servlet.ServletException,
hudson.model.Descriptor.FormException,
IOException
public void syncBranches(hudson.model.TaskListener listener)
_syncBranches(TaskListener) and logging
its exceptions to the listener.public String getSyncBranchesCron()
@Exported(visibility=2,
name="color")
public hudson.model.BallColor getIconColor()
@Exported(name="healthReport") public List<hudson.model.HealthReport> getBuildHealthReports()
public void makeDisabled(boolean b)
throws IOException
public static List<hudson.model.ViewDescriptor> getViewDescriptors()
public hudson.model.AbstractProject<?,?> asProject()
public hudson.util.DescribableList<hudson.tasks.Publisher,hudson.model.Descriptor<hudson.tasks.Publisher>> getPublishersList()
protected void buildDependencyGraph(hudson.model.DependencyGraph graph)
public boolean isFingerprintConfigured()
protected void submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException,
hudson.model.Descriptor.FormException
protected List<hudson.model.Action> createTransientActions()
public static List<jenkins.scm.api.SCMSourceDescriptor> getSCMSourceDescriptors(boolean onlyUserInstantiable)
public static String rawDecode(String s)
Util.rawEncode(String).
Kanged from Branch API.s - the encoded string.public static void enforceProjectStateOnUpdated(hudson.model.Item item)
NullSCM.item - - the item that was just updatedCopyright © 2004-2015. All Rights Reserved.