Package jenkins.branch
Class MultiBranchProjectFactory.BySCMSourceCriteria
java.lang.Object
hudson.model.AbstractDescribableImpl<MultiBranchProjectFactory>
jenkins.branch.MultiBranchProjectFactory
jenkins.branch.MultiBranchProjectFactory.BySCMSourceCriteria
- All Implemented Interfaces:
ExtensionPoint
,Describable<MultiBranchProjectFactory>
- Enclosing class:
- MultiBranchProjectFactory
public abstract static class MultiBranchProjectFactory.BySCMSourceCriteria
extends MultiBranchProjectFactory
Creates a particular kind of multibranch project insofar as at least one
SCMHead
satisfies a probe.-
Nested Class Summary
Nested classes/interfaces inherited from class jenkins.branch.MultiBranchProjectFactory
MultiBranchProjectFactory.BySCMSourceCriteria
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal MultiBranchProject<?,
?> createNewProject
(ItemGroup<?> parent, String name, List<? extends jenkins.scm.api.SCMSource> scmSources, Map<String, Object> attributes, TaskListener listener) protected abstract MultiBranchProject<?,
?> protected abstract jenkins.scm.api.SCMSourceCriteria
getSCMSourceCriteria
(jenkins.scm.api.SCMSource source) Defines how to decide whether or not a given repository should host our type of project.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
.Methods inherited from class jenkins.branch.MultiBranchProjectFactory
createProject, getDescriptor, updateExistingProject
-
Constructor Details
-
BySCMSourceCriteria
public BySCMSourceCriteria()
-
-
Method Details
-
getSCMSourceCriteria
@CheckForNull protected abstract jenkins.scm.api.SCMSourceCriteria getSCMSourceCriteria(@NonNull jenkins.scm.api.SCMSource source) Defines how to decide whether or not a given repository should host our type of project.- Parameters:
source
- a repository- Returns:
- criteria for treating its branches as a match (or
null
if all branches match)
-
doCreateProject
@NonNull protected abstract MultiBranchProject<?,?> doCreateProject(@NonNull ItemGroup<?> parent, @NonNull String name, @NonNull Map<String, Object> attributes) throws IOException, InterruptedExceptionHistorical alias forcreateNewProject(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 nameSCMSourceObserver.ProjectObserver.addSource(jenkins.scm.api.SCMSource)
attributes
- a set of metadata attributes as added bySCMSourceObserver.ProjectObserver.addAttribute(java.lang.String, java.lang.Object)
- 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.
-
createNewProject
@NonNull public final 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 matchesMultiBranchProjectFactory.recognizes(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)
.- Overrides:
createNewProject
in classMultiBranchProjectFactory
- 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:
IOException
- if there was an IO error.InterruptedException
- if interrupted.
-
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.- Overrides:
recognizes
in classMultiBranchProjectFactory
- 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:
IOException
- if there was an IO error.InterruptedException
- if interrupted.
-
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
.- Overrides:
recognizes
in classMultiBranchProjectFactory
- 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:
IOException
- if there was an IO error.InterruptedException
- if interrupted.
-