public abstract class TemplateDrivenMultiBranchProject<P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem,B extends hudson.model.AbstractBuild<P,B>>
extends jenkins.branch.MultiBranchProject<P,B>
implements hudson.model.TopLevelItem, jenkins.scm.api.SCMSourceOwner
| Modifier and Type | Class and Description |
|---|---|
static class |
TemplateDrivenMultiBranchProject.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 |
TemplateDrivenMultiBranchProject.BranchProjectSaveListener
Additional listener for changes to Items via config.xml POST, used to enforce state for
multi-branch projects and their sub-projects.
|
jenkins.branch.MultiBranchProject.BranchIndexing<P extends hudson.model.Job<P,R> & hudson.model.TopLevelItem,R extends hudson.model.Run<P,R>>, jenkins.branch.MultiBranchProject.SCMEventListenerImpl, jenkins.branch.MultiBranchProject.StateActionFactorycom.cloudbees.hudson.plugins.folder.AbstractFolder.ItemListenerImpl, com.cloudbees.hudson.plugins.folder.AbstractFolder.RunListenerImpl| Modifier and Type | Field and Description |
|---|---|
protected boolean |
disabled |
protected P |
template |
static String |
TEMPLATE |
| Constructor and Description |
|---|
TemplateDrivenMultiBranchProject(hudson.model.ItemGroup parent,
String name)
Constructor, mandated by
TopLevelItem. |
| Modifier and Type | Method and Description |
|---|---|
void |
disable() |
org.kohsuke.stapler.HttpResponse |
doDisable() |
org.kohsuke.stapler.HttpResponse |
doEnable() |
void |
enable() |
static void |
enforceProjectStateOnUpdated(hudson.model.Item item)
Triggered by different listeners to enforce state for multi-branch projects and their sub-projects.
|
hudson.model.Run |
getFirstBuild()
Returns the oldest build in the record.
|
hudson.model.Run |
getLastBuild()
Returns the last build.
|
hudson.model.Run |
getLastCompletedBuild()
Returns the last completed build, if any.
|
hudson.model.Run |
getLastFailedBuild()
Returns the last failed build, if any.
|
hudson.model.Run |
getLastStableBuild()
Returns the last stable build, if any.
|
hudson.model.Run |
getLastSuccessfulBuild()
Returns the last successful build, if any.
|
hudson.model.Run |
getLastUnstableBuild()
Returns the last unstable build, if any.
|
hudson.model.Run |
getLastUnsuccessfulBuild()
Returns the last build that was anything but stable, if any.
|
String |
getPronoun()
Get the term used in the UI to represent this kind of
AbstractProject. |
File |
getRootDirFor(P child) |
P |
getTemplate()
Retrieves the template sub-project.
|
File |
getTemplateDir()
Returns the "template" directory inside the project directory.
|
static List<hudson.model.ViewDescriptor> |
getViewDescriptors()
Returns a list of
ViewDescriptors that we want to use for this project type. |
protected void |
init3()
Common initialization that is invoked when either a new project is created with the constructor
TemplateDrivenMultiBranchProject(ItemGroup, String) or when a project
is loaded from disk with onLoad(ItemGroup, String). |
protected void |
initViews(List<hudson.model.View> views)
Overrides view initialization to use BranchListView instead of AllView.
|
boolean |
isBuildable() |
boolean |
isConfigurable()
Gets whether or not this item is configurable (always true).
|
boolean |
isDisabled()
Gets whether this project is disabled.
|
void |
makeDisabled(boolean b)
Marks the build as disabled.
|
protected abstract P |
newTemplate()
Should create a new project using this
TemplateDrivenMultiBranchProject as the parent and
TEMPLATE as the name. |
void |
onCopiedFrom(hudson.model.Item src)
If copied, also copy the
template. |
void |
onLoad(hudson.model.ItemGroup<? extends hudson.model.Item> parent,
String name) |
void |
submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
Sets various implementation-specific fields and forwards wrapped req/rsp objects on to the
template's AbstractProject.doConfigSubmit(StaplerRequest, StaplerResponse) method. |
boolean |
supportsMakeDisabled()
Specifies whether this project may be disabled by the user.
|
computeChildren, createComputation, getACL, getBranch, getBranchPropertyStrategy, getComputationDir, getDescription, getDescriptor, getDisplayName, getIconClassName, getIndexing, getItem, getItemByBranchName, getJobsDir, getProjectClass, getProjectFactory, getSCMSource, getSCMSourceCriteria, getSCMSources, getSources, getSourcesList, getView, getWelcomeView, isHasEvents, newDefaultFolderIcon, newFolderViewHolder, newProjectFactory, onSCMSourceUpdated, orphanedItems, rawDecode, setProjectFactory, setSourcesListaddTrigger, checkAbortPermission, createEventsChildObserver, createExecutable, doBuild, doConfigSubmit, getActions, getAssignedLabel, getCauseOfBlockage, getComputation, getDefaultAuthentication, getDefaultAuthentication, getEstimatedDuration, getLastBuiltOn, getOrphanedItemStrategy, getOrphanedItemStrategyDescriptors, getOwnerTask, getResourceList, getSameNodeConstraint, getSubTasks, getSuccessfulDestination, getTriggers, getWhyBlocked, hasAbortPermission, init, isBuildBlocked, isConcurrentBuild, onCreatedFromScratch, recalculateAfterSubmitted, renameBlocker, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild, scheduleBuild2, setOrphanedItemStrategyaddAction, addOrReplaceAction, addProperty, addView, canDelete, delete, deleteView, doChildrenContextMenu, doCreateView, doDoRename, doLastBuild, doSubmitDescription, doViewExistsCheck, getAllJobs, getBuildHealth, getBuildHealthReports, getFolderViews, getHealthMetrics, getIcon, getIconColor, getItemGroup, getItems, getJob, getOverrides, getPrimaryView, getProperties, getRootDirFor, getStaplerFallback, getUrlChildPrefix, getViewActions, getViews, getViewsTabBar, invalidateBuildHealthReports, itemsPut, loadChildren, loadJobTotal, makeSearchIndex, newDefaultViewsTabBar, onDeleted, onRenamed, onViewRenamed, removeAction, removeActions, renameTo, replaceAction, replaceActions, resetFolderViews, save, setIcon, setPrimaryViewcheckPermission, delete, doConfigDotXml, doDoDelete, doReload, doSetName, getAbsoluteUrl, getApi, getConfigFile, getDescriptorByName, getDisplayNameOrNull, getFullDisplayName, getFullName, getName, getParent, getRelativeDisplayNameFrom, getRelativeNameFrom, getRelativeNameFrom, getRelativeNameFromGroup, getRootDir, getSearchName, getSearchUrl, getShortUrl, getUrl, hasPermission, movedTo, performDelete, resolveForCLI, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXmldoContextMenu, getAction, getAction, getActions, getAllActions, getDynamicgetSearch, getSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetSCMSource, getSCMSourceCriteria, getSCMSources, onSCMSourceUpdateddelete, getAbsoluteUrl, getAllJobs, getDisplayName, getFullDisplayName, getFullName, getName, getParent, getRelativeNameFrom, getRelativeNameFrom, getShortUrl, getUrl, onCreatedFromScratch, savegetSearchIndex, getSearchName, getSearchUrlpublic static final String TEMPLATE
protected volatile boolean disabled
public TemplateDrivenMultiBranchProject(hudson.model.ItemGroup parent,
String name)
TopLevelItem.parent - the parent of this multi-branch job.name - the name of the multi-branch job.public void onLoad(hudson.model.ItemGroup<? extends hudson.model.Item> parent,
String name)
throws IOException
protected void init3()
TemplateDrivenMultiBranchProject(ItemGroup, String) or when a project
is loaded from disk with onLoad(ItemGroup, String).protected abstract P newTemplate()
TemplateDrivenMultiBranchProject as the parent and
TEMPLATE as the name.template.protected void initViews(List<hudson.model.View> views) throws IOException
initViews in class com.cloudbees.hudson.plugins.folder.AbstractFolder<P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem>IOExceptionpublic P getTemplate()
@Nonnull public File getTemplateDir()
@Nonnull public File getRootDirFor(P child)
getRootDirFor in interface hudson.model.ItemGroup<P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem>getRootDirFor in class jenkins.branch.MultiBranchProject<P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem,B extends hudson.model.AbstractBuild<P,B>>public void onCopiedFrom(hudson.model.Item src)
template.
onCopiedFrom in interface hudson.model.ItemonCopiedFrom in class hudson.model.AbstractItempublic void submit(org.kohsuke.stapler.StaplerRequest req,
org.kohsuke.stapler.StaplerResponse rsp)
throws javax.servlet.ServletException,
hudson.model.Descriptor.FormException,
IOException
template's AbstractProject.doConfigSubmit(StaplerRequest, StaplerResponse) method.
@CheckForNull @Exported public hudson.model.Run getLastBuild()
@CheckForNull @Exported public hudson.model.Run getFirstBuild()
@CheckForNull @Exported public hudson.model.Run getLastSuccessfulBuild()
Result.SUCCESS or Result.UNSTABLE.getLastStableBuild()@CheckForNull @Exported public hudson.model.Run getLastUnsuccessfulBuild()
getLastSuccessfulBuild()@CheckForNull @Exported public hudson.model.Run getLastUnstableBuild()
getLastSuccessfulBuild()@CheckForNull @Exported public hudson.model.Run getLastStableBuild()
getLastSuccessfulBuild()@CheckForNull @Exported public hudson.model.Run getLastFailedBuild()
@CheckForNull @Exported public hudson.model.Run getLastCompletedBuild()
public boolean isBuildable()
public boolean isDisabled()
public void makeDisabled(boolean b)
throws IOException
b - true - disable, false - enableIOException - if problem savingpublic boolean supportsMakeDisabled()
TopLevelItem; would be false for matrix configurations, etc.doDisable() and the likepublic void disable()
throws IOException
IOExceptionpublic void enable()
throws IOException
IOException@CLIMethod(name="disable-job")
public org.kohsuke.stapler.HttpResponse doDisable()
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletException@CLIMethod(name="enable-job")
public org.kohsuke.stapler.HttpResponse doEnable()
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic boolean isConfigurable()
public String getPronoun()
AbstractProject. Must start with a capital letter.public static List<hudson.model.ViewDescriptor> getViewDescriptors()
ViewDescriptors that we want to use for this project type. Used by newView.jelly.ViewDescriptors that we want to use for this project typepublic static void enforceProjectStateOnUpdated(hudson.model.Item item)
item - the item that was just updatedCopyright © 2016–2017. All rights reserved.