Package jenkins.branch
Class MultiBranchProjectFactory
java.lang.Object
hudson.model.AbstractDescribableImpl<MultiBranchProjectFactory>
jenkins.branch.MultiBranchProjectFactory
- All Implemented Interfaces:
ExtensionPoint
,Describable<MultiBranchProjectFactory>
- Direct Known Subclasses:
MultiBranchProjectFactory.BySCMSourceCriteria
public abstract class MultiBranchProjectFactory
extends AbstractDescribableImpl<MultiBranchProjectFactory>
implements ExtensionPoint
Creates
MultiBranchProject
s for repositories where recognized.
Please define a 'getting-started' view for a subclass, if you would like to provide specific information to the user
how to get started using the type of project factory. This view is displayed when there are no subfolders found.- Since:
- 0.2-beta-5
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Creates a particular kind of multibranch project insofar as at least oneSCMHead
satisfies a probe.Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionMultiBranchProject<?,
?> createNewProject
(ItemGroup<?> parent, String name, List<? extends jenkins.scm.api.SCMSource> scmSources, Map<String, Object> attributes, TaskListener listener) Creates a new multibranch project which matchesrecognizes(hudson.model.ItemGroup<?>, java.lang.String, java.util.List<? extends jenkins.scm.api.SCMSource>, java.util.Map<java.lang.String, java.lang.Object>, hudson.model.TaskListener)
.MultiBranchProject<?,
?> createProject
(ItemGroup<?> parent, String name, List<? extends jenkins.scm.api.SCMSource> scmSources, Map<String, Object> attributes, TaskListener listener) Deprecated.boolean
recognizes
(ItemGroup<?> parent, String name, List<? extends jenkins.scm.api.SCMSource> scmSources, Map<String, Object> attributes, TaskListener listener) Determines whether this factory recognizes a given configuration.boolean
recognizes
(ItemGroup<?> parent, String name, List<? extends jenkins.scm.api.SCMSource> scmSources, Map<String, Object> attributes, jenkins.scm.api.SCMHeadEvent<?> event, TaskListener listener) Determines whether this factory recognizes a given configuration scoped to a specificSCMHeadEvent
.void
updateExistingProject
(MultiBranchProject<?, ?> project, Map<String, Object> attributes, TaskListener listener)
-
Constructor Details
-
MultiBranchProjectFactory
public MultiBranchProjectFactory()
-
-
Method Details
-
recognizes
public boolean recognizes(@NonNull ItemGroup<?> parent, @NonNull String name, @NonNull List<? extends jenkins.scm.api.SCMSource> scmSources, @NonNull Map<String, Object> attributes, @NonNull TaskListener listener) throws IOException, InterruptedExceptionDetermines whether this factory recognizes a given configuration.- Parameters:
parent
- a foldername
- a project namescmSources
- a set of SCM sources as added bySCMSourceObserver.ProjectObserver.addSource(jenkins.scm.api.SCMSource)
attributes
- a set of metadata attributes as added bySCMSourceObserver.ProjectObserver.addAttribute(java.lang.String, java.lang.Object)
listener
- a way of reporting progress- Returns:
- true if recognized
- Throws:
InterruptedException
- if interrupted.IOException
- if there was an IO error.
-
recognizes
public boolean recognizes(@NonNull ItemGroup<?> parent, @NonNull String name, @NonNull List<? extends jenkins.scm.api.SCMSource> scmSources, @NonNull Map<String, Object> attributes, @CheckForNull jenkins.scm.api.SCMHeadEvent<?> event, @NonNull TaskListener listener) throws IOException, InterruptedExceptionDetermines whether this factory recognizes a given configuration scoped to a specificSCMHeadEvent
.- Parameters:
parent
- a foldername
- a project namescmSources
- a set of SCM sources as added bySCMSourceObserver.ProjectObserver.addSource(jenkins.scm.api.SCMSource)
attributes
- a set of metadata attributes as added bySCMSourceObserver.ProjectObserver.addAttribute(java.lang.String, java.lang.Object)
event
- theSCMHeadEvent
that the recognition test should be restricted to.listener
- a way of reporting progress- Returns:
- true if recognized
- Throws:
InterruptedException
- if interrupted.IOException
- if there was an IO error.- Since:
- 2.0
-
createNewProject
@NonNull public MultiBranchProject<?,?> createNewProject(@NonNull ItemGroup<?> parent, @NonNull String name, @NonNull List<? extends jenkins.scm.api.SCMSource> scmSources, @NonNull Map<String, Object> attributes, @NonNull TaskListener listener) throws IOException, InterruptedExceptionCreates a new multibranch project which matchesrecognizes(hudson.model.ItemGroup<?>, java.lang.String, java.util.List<? extends jenkins.scm.api.SCMSource>, java.util.Map<java.lang.String, java.lang.Object>, hudson.model.TaskListener)
.- Parameters:
parent
- a foldername
- a project namescmSources
- a set of SCM sources as added bySCMSourceObserver.ProjectObserver.addSource(jenkins.scm.api.SCMSource)
attributes
- a set of metadata attributes as added bySCMSourceObserver.ProjectObserver.addAttribute(java.lang.String, java.lang.Object)
listener
- a way of reporting progress- Returns:
- a new uninitialized multibranch project (do not configure its
MultiBranchProject.getSourcesList()
or callComputedFolder.onCreatedFromScratch()
) - Throws:
InterruptedException
- if interrupted.IOException
- if there was an IO error.
-
updateExistingProject
public void updateExistingProject(@NonNull MultiBranchProject<?, ?> project, @NonNull Map<String, throws IOException, InterruptedExceptionObject> attributes, @NonNull TaskListener listener) Updates an existing project which matchesrecognizes(hudson.model.ItemGroup<?>, java.lang.String, java.util.List<? extends jenkins.scm.api.SCMSource>, java.util.Map<java.lang.String, java.lang.Object>, hudson.model.TaskListener)
.- Parameters:
project
- an existing project, perhaps created by this factory, perhaps notattributes
- a set of metadata attributes as added bySCMSourceObserver.ProjectObserver.addAttribute(java.lang.String, java.lang.Object)
listener
- a way of reporting progress- Throws:
InterruptedException
- if interrupted.IOException
- if there was an IO error.
-
createProject
@Deprecated @CheckForNull public MultiBranchProject<?,?> createProject(@NonNull ItemGroup<?> parent, @NonNull String name, @NonNull List<? extends jenkins.scm.api.SCMSource> scmSources, @NonNull Map<String, Object> attributes, @NonNull TaskListener listener) throws IOException, InterruptedExceptionDeprecated.Creates a new multibranch project which matchesrecognizes(hudson.model.ItemGroup<?>, java.lang.String, java.util.List<? extends jenkins.scm.api.SCMSource>, java.util.Map<java.lang.String, java.lang.Object>, hudson.model.TaskListener)
.- Parameters:
parent
- a foldername
- a project namescmSources
- a set of SCM sources as added bySCMSourceObserver.ProjectObserver.addSource(jenkins.scm.api.SCMSource)
attributes
- a set of metadata attributes as added bySCMSourceObserver.ProjectObserver.addAttribute(java.lang.String, java.lang.Object)
listener
- a way of reporting progress- Returns:
- a new uninitialized multibranch project (do not configure its
MultiBranchProject.getSourcesList()
or callComputedFolder.onCreatedFromScratch()
) - Throws:
InterruptedException
- if interrupted.IOException
- if there was an IO error.
-
getDescriptor
- Specified by:
getDescriptor
in interfaceDescribable<MultiBranchProjectFactory>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<MultiBranchProjectFactory>
-
createNewProject(ItemGroup, String, List, Map, TaskListener)