P - the project typeR - the run typepublic abstract class MultiBranchProject<P extends Job<P,R> & TopLevelItem,R extends Run<P,R>> extends com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P> implements jenkins.scm.api.SCMSourceOwner, org.jenkins.ui.icon.IconSpec
| Modifier and Type | Class and Description |
|---|---|
static class |
MultiBranchProject.BranchIndexing<P extends Job<P,R> & TopLevelItem,R extends Run<P,R>>
Represents the branch indexing job.
|
static class |
MultiBranchProject.CopyItemVeto
Veto attempts to copy branch projects outside of their multibranch container.
|
static class |
MultiBranchProject.SCMEventListenerImpl
Our event listener.
|
static class |
MultiBranchProject.StateActionFactory
Adds the
MultiBranchProject.State.sourceActions to Actionable.getAllActions(). |
com.cloudbees.hudson.plugins.folder.AbstractFolder.ItemListenerImpl, com.cloudbees.hudson.plugins.folder.AbstractFolder.RunListenerImplExtensionPoint.LegacyInstancesAreScopedToHudsonModelObjectWithContextMenu.ContextMenu, ModelObjectWithContextMenu.ContextMenuVisibility, ModelObjectWithContextMenu.MenuItemdescription, displayName, name, PRONOUN, SKIP_PERMISSION_CHECK, TASK_NOUN| Modifier | Constructor and Description |
|---|---|
protected |
MultiBranchProject(ItemGroup parent,
String name)
Constructor, mandated by
TopLevelItem. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
computeChildren(com.cloudbees.hudson.plugins.folder.computed.ChildObserver<P> observer,
TaskListener listener) |
protected com.cloudbees.hudson.plugins.folder.computed.FolderComputation<P> |
createComputation(com.cloudbees.hudson.plugins.folder.computed.FolderComputation<P> previous) |
protected void |
fireSCMSourceAfterSave(List<jenkins.scm.api.SCMSource> sources)
Fires the
SCMSource.afterSave() method for the supplied sources. |
ACL |
getACL() |
P |
getBranch(String name)
Deprecated.
use
getItem(String) or AbstractFolder.getJob(String) directly |
BranchPropertyStrategy |
getBranchPropertyStrategy(jenkins.scm.api.SCMSource source)
Returns the
BranchPropertyStrategy for a specific SCMSource. |
File |
getComputationDir()
Returns the directory that branch indexing is stored in.
|
String |
getDescription() |
MultiBranchProjectDescriptor |
getDescriptor() |
String |
getDisplayName() |
String |
getIconClassName() |
MultiBranchProject.BranchIndexing<P,R> |
getIndexing()
Returns the current/most recent indexing details.
|
P |
getItem(String name)
Returns the named child job or
null if no such job exists. |
P |
getItemByBranchName(String branchName)
Returns the child job with the specified branch name or
null if no such child job exists. |
File |
getJobsDir()
Returns the directory that all branches are stored in.
|
Class<P> |
getProjectClass()
Returns the base class of the projects that are managed by this
MultiBranchProject. |
BranchProjectFactory<P,R> |
getProjectFactory()
Returns the
BranchProjectFactory. |
File |
getRootDirFor(P child) |
jenkins.scm.api.SCMSource |
getSCMSource(String sourceId) |
jenkins.scm.api.SCMSourceCriteria |
getSCMSourceCriteria(jenkins.scm.api.SCMSource source) |
List<jenkins.scm.api.SCMSource> |
getSCMSources() |
String |
getSourcePronoun()
Get the term used in the UI to represent the souce for this kind of
Item. |
List<BranchSource> |
getSources()
The sources of branches.
|
PersistedList<BranchSource> |
getSourcesList()
Offers direct access to the configurable list of branch sources.
|
View |
getView(String name) |
protected View |
getWelcomeView()
Creates a place-holder view when there's no active branch indexed.
|
boolean |
isBuildable() |
boolean |
isHasEvents() |
protected com.cloudbees.hudson.plugins.folder.FolderIcon |
newDefaultFolderIcon() |
protected com.cloudbees.hudson.plugins.folder.views.AbstractFolderViewHolder |
newFolderViewHolder() |
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 |
onLoad(ItemGroup<? extends Item> parent,
String name) |
void |
onSCMSourceUpdated(jenkins.scm.api.SCMSource source) |
protected Collection<P> |
orphanedItems(Collection<P> orphaned,
TaskListener listener) |
static String |
rawDecode(String s)
Inverse function of
Util.rawEncode(String) |
void |
setProjectFactory(BranchProjectFactory<P,R> projectFactory)
Sets the
BranchProjectFactory. |
void |
setSourcesList(List<BranchSource> sources)
Offers direct access to set the configurable list of branch sources while preserving
branch source id associations for sources that are otherwise unmodified
|
protected void |
submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp) |
addTrigger, checkAbortPermission, checkRename, createEventsChildObserver, createExecutable, doBuild, doConfigSubmit, getActions, getAssignedLabel, getCauseOfBlockage, getComputation, getDefaultAuthentication, getDefaultAuthentication, getEstimatedDuration, getLastBuiltOn, getLastFailedBuild, getLastStableBuild, getLastSuccessfulBuild, getOrphanedItemStrategy, getOrphanedItemStrategyDescriptors, getOwnerTask, getResourceList, getSameNodeConstraint, getSubTasks, getSuccessfulDestination, getTriggerDescriptors, getTriggers, getWhyBlocked, hasAbortPermission, init, isBuildBlocked, isConcurrentBuild, isDisabled, onCreatedFromScratch, openEventsChildObserver, recalculateAfterSubmitted, removeTrigger, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild2, setDisabled, setOrphanedItemStrategy, supportsMakeDisabledaddProperty, addView, canDelete, delete, deleteView, doChildrenContextMenu, doCreateView, doDisable, doEnable, doLastBuild, doSubmitDescription, doViewExistsCheck, getAllJobs, getBuildHealth, getBuildHealthReports, getFolderViews, getHealthMetrics, getIcon, getIconColor, getItemGroup, getItems, getJob, getOverrides, getPrimaryView, getPronoun, getProperties, getRootDirFor, getStaplerFallback, getUrlChildPrefix, getViewActions, getViews, getViewsTabBar, initViews, invalidateBuildHealthReports, isNameEditable, itemsPut, loadChildren, loadJobTotal, makeDisabled, makeSearchIndex, newDefaultViewsTabBar, onDeleted, onRenamed, onViewRenamed, renameBlocker, renameTo, resetFolderViews, save, setIcon, setPrimaryViewdelete, doCheckNewName, doConfigDotXml, doConfirmRename, doDoDelete, doReload, doSetName, getAbsoluteUrl, getApi, getConfigFile, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getTarget, getTaskNoun, getUrl, movedTo, onCopiedFrom, performDelete, resolveForCLI, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXml, writeConfigDotXmladdAction, addOrReplaceAction, doContextMenu, getAction, getAction, getActions, getAllActions, getDynamic, removeAction, removeActions, replaceAction, replaceActionsgetSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitdelete, getAbsoluteUrl, getAllJobs, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCopiedFrom, onCreatedFromScratch, savegetRootDirgetSearchgetSearchIndex, getSearchName, getSearchUrlcheckPermission, hasPermission, hasPermissiongetFullDisplayName, getName, getUrlallItems, allItems, getAllItems, getAllItems, getFullDisplayName, getFullName, getUrlgetDescriptorByNameprotected MultiBranchProject(ItemGroup parent, String name)
TopLevelItem.parent - the parent of this multibranch job.name - the name of the multibranch job.public void onLoad(ItemGroup<? extends Item> parent, String name) throws IOException
onLoad in interface ItemonLoad in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>IOExceptionprotected com.cloudbees.hudson.plugins.folder.views.AbstractFolderViewHolder newFolderViewHolder()
newFolderViewHolder in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,R> & TopLevelItem>protected com.cloudbees.hudson.plugins.folder.FolderIcon newDefaultFolderIcon()
newDefaultFolderIcon in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,R> & TopLevelItem>public String getIconClassName()
getIconClassName in interface org.jenkins.ui.icon.IconSpecpublic String getSourcePronoun()
Item. Must start with a capital letter.@NonNull public BranchProjectFactory<P,R> getProjectFactory()
BranchProjectFactory. ˜BranchProjectFactory.public final Class<P> getProjectClass()
MultiBranchProject.MultiBranchProject.public void setProjectFactory(BranchProjectFactory<P,R> projectFactory)
BranchProjectFactory.projectFactory - the new BranchProjectFactory.@NonNull protected abstract BranchProjectFactory<P,R> newProjectFactory()
BranchProjectFactory.@Exported @NonNull public List<BranchSource> getSources()
@NonNull public PersistedList<BranchSource> getSourcesList()
public void setSourcesList(List<BranchSource> sources) throws IOException
sources - the new sources.IOException - if the sources could not be persisted to disk.@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.SCMSourceOwner@CheckForNull public BranchPropertyStrategy getBranchPropertyStrategy(@NonNull jenkins.scm.api.SCMSource source)
BranchPropertyStrategy for a specific SCMSource.source - the specific SCMSource.BranchPropertyStrategy to use.@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.SCMSourceOwnerpublic boolean isHasEvents()
isHasEvents in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>protected void computeChildren(com.cloudbees.hudson.plugins.folder.computed.ChildObserver<P> observer, TaskListener listener) throws IOException, InterruptedException
computeChildren in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>IOExceptionInterruptedExceptionprotected Collection<P> orphanedItems(Collection<P> orphaned, TaskListener listener) throws IOException, InterruptedException
orphanedItems in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>IOExceptionInterruptedException@CheckForNull public P getItem(String name)
null if no such job exists.@CheckForNull public P getItemByBranchName(@NonNull String branchName)
null if no such child job exists.branchName - the name of the branch.null if no such job exists or if the requesting user does ave permission to
view it.@Deprecated @CheckForNull public P getBranch(String name)
getItem(String) or AbstractFolder.getJob(String) directlynull if no such branch exists.name - the name of the branchnull if no such branch exists.public ACL getACL()
getACL in interface AccessControlledgetACL in class AbstractItempublic String getDescription()
getDescription in class AbstractItempublic String getDisplayName()
getDisplayName in interface ItemgetDisplayName in interface ModelObjectgetDisplayName in interface ResourceActivitygetDisplayName in class AbstractItem@NonNull public File getJobsDir()
getJobsDir in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,R> & TopLevelItem>public File getRootDirFor(P child)
getRootDirFor in interface ItemGroup<P extends Job<P,R> & TopLevelItem>getRootDirFor in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,R> & TopLevelItem>@NonNull public File getComputationDir()
getComputationDir in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>@NonNull public MultiBranchProjectDescriptor getDescriptor()
getDescriptor in interface Describable<TopLevelItem>getDescriptor in interface TopLevelItemgetDescriptor in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends Job<P,R> & TopLevelItem>public MultiBranchProject.BranchIndexing<P,R> getIndexing()
protected void submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws IOException,
javax.servlet.ServletException,
Descriptor.FormException
submit in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>IOExceptionjavax.servlet.ServletExceptionDescriptor.FormExceptionprotected void fireSCMSourceAfterSave(List<jenkins.scm.api.SCMSource> sources)
SCMSource.afterSave() method for the supplied sources.sources - the sources.protected View getWelcomeView()
public boolean isBuildable()
isBuildable in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>protected com.cloudbees.hudson.plugins.folder.computed.FolderComputation<P> createComputation(com.cloudbees.hudson.plugins.folder.computed.FolderComputation<P> previous)
createComputation in class com.cloudbees.hudson.plugins.folder.computed.ComputedFolder<P extends Job<P,R> & TopLevelItem>@NonNull public static String rawDecode(@NonNull String s)
Util.rawEncode(String)s - the encoded string.Copyright © 2016–2019. All rights reserved.