public abstract class AbstractMultiBranchProject<P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem,B extends hudson.model.AbstractBuild<P,B>>
extends hudson.model.AbstractItem
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.
|
static class |
AbstractMultiBranchProject.SyncBranchesTransientActionFactory
Adds
SyncBranchesTrigger.SyncBranchesAction to the list of
actions on AbstractMultiBranchProjects, effectively showing it
on the sidepanel. |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
disabled |
protected String |
primaryView |
protected jenkins.scm.api.SCMSource |
scmSource |
protected SyncBranchesTrigger |
syncBranchesTrigger |
protected P |
templateProject |
protected hudson.util.DescribableList<hudson.triggers.Trigger<?>,hudson.triggers.TriggerDescriptor> |
triggers |
| Constructor and Description |
|---|
AbstractMultiBranchProject(hudson.model.ItemGroup parent,
String name) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
void |
delete()
Overrides the
AbstractItem implementation to also
delete the subprojects before deleting this parent project. |
void |
deleteView(hudson.model.View view) |
void |
disable() |
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.
|
org.kohsuke.stapler.HttpResponse |
doDisable() |
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. |
org.kohsuke.stapler.HttpResponse |
doEnable() |
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.
|
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.security.ACL |
getACL()
For project matrix auth, use custom implementation with ACL from
template project, otherwise infinite loops are all too possible.
|
Collection<? extends hudson.model.Job> |
getAllJobs() |
P |
getBranch(String name)
Stapler URL binding for ${rootUrl}/job/${project}/branch/${branchProject}
|
File |
getBranchesDir()
Returns the "branches" directory inside the project directory.
|
hudson.model.HealthReport |
getBuildHealth()
Get the current health report for a job.
|
List<hudson.model.HealthReport> |
getBuildHealthReports()
Get the current health reports for a job.
|
B |
getFirstBuild()
Returns the oldest build in the record.
|
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() |
B |
getLastBuild()
Returns the last build.
|
B |
getLastCompletedBuild()
Returns the last completed build, if any.
|
B |
getLastFailedBuild()
Returns the last failed build, if any.
|
B |
getLastStableBuild()
Returns the last stable build, if any.
|
B |
getLastSuccessfulBuild()
Returns the last successful build, if any.
|
B |
getLastUnstableBuild()
Returns the last unstable build, if any.
|
B |
getLastUnsuccessfulBuild()
Returns the last build that was anything but stable, if any.
|
hudson.model.View |
getPrimaryView() |
String |
getPronoun()
Get the term used in the UI to represent this kind of
AbstractProject. |
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() |
String |
getSyncBranchesCron()
Used by Jelly to populate the Sync Branches Schedule field on the
configuration page.
|
SyncBranchesTrigger |
getSyncBranchesTrigger()
Gets this project's
SyncBranchesTrigger. |
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 |
isConfigurable() |
boolean |
isDisabled() |
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. |
boolean |
supportsMakeDisabled()
Specifies whether this project may be disabled by the user.
|
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. |
checkPermission, 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, onCopiedFrom, onCreatedFromScratch, performDelete, renameTo, resolveForCLI, save, setDescription, setDisplayName, setDisplayNameOrNull, toString, updateByXml, updateByXmladdAction, doContextMenu, getAction, getAction, getActions, getActions, getAllActions, getDynamic, replaceActiongetSearch, getSearchIndex, makeSearchIndex, requirePOST, sendError, sendError, sendError, sendError, sendErrorclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitprotected volatile String primaryView
protected volatile boolean disabled
protected transient P extends hudson.model.AbstractProject<P,B> & hudson.model.TopLevelItem templateProject
protected transient hudson.util.DescribableList<hudson.triggers.Trigger<?>,hudson.triggers.TriggerDescriptor> triggers
protected volatile SyncBranchesTrigger syncBranchesTrigger
protected volatile jenkins.scm.api.SCMSource scmSource
public AbstractMultiBranchProject(hudson.model.ItemGroup parent,
String name)
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.AbstractItemIOExceptionprotected 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()
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 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.AbstractItemreq - - Stapler requestrsp - - Stapler responseIOException - - if problemsInterruptedException - - if problemspublic void delete()
throws IOException,
InterruptedException
AbstractItem implementation to also
delete the subprojects before deleting this parent project.
Inherited docs:
delete in interface hudson.model.Itemdelete in class hudson.model.AbstractItemIOException - - 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
javax.servlet.ServletExceptionhudson.model.Descriptor.FormExceptionIOExceptionpublic SyncBranchesTrigger getSyncBranchesTrigger()
SyncBranchesTrigger.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()
public hudson.model.HealthReport getBuildHealth()
@Exported(name="healthReport") public List<hudson.model.HealthReport> getBuildHealthReports()
@Exported public B getLastBuild()
@Exported public B getFirstBuild()
@Exported public B getLastSuccessfulBuild()
Result.SUCCESS or Result.UNSTABLE.getLastStableBuild()@Exported public B getLastUnsuccessfulBuild()
getLastSuccessfulBuild()@Exported public B getLastUnstableBuild()
getLastSuccessfulBuild()@Exported public B getLastStableBuild()
getLastSuccessfulBuild()@Exported public B getLastFailedBuild()
@Exported public B getLastCompletedBuild()
public Collection<? extends hudson.model.Job> getAllJobs()
getAllJobs in interface hudson.model.ItemgetAllJobs in class hudson.model.AbstractItempublic boolean isDisabled()
public void makeDisabled(boolean b)
throws IOException
IOExceptionpublic 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 hudson.security.ACL getACL()
getACL in interface hudson.security.AccessControlledgetACL in class hudson.model.AbstractItempublic boolean isConfigurable()
public String getPronoun()
AbstractProject. Must start with a capital letter.getPronoun in class hudson.model.AbstractItempublic static List<hudson.model.ViewDescriptor> getViewDescriptors()
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)
item - - the item that was just updatedCopyright © 2004-2015. All Rights Reserved.