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 oneSCMHead
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
Constructors Constructor Description BySCMSourceCriteria()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description MultiBranchProject<?,?>
createNewProject(ItemGroup<?> parent, String name, List<? extends jenkins.scm.api.SCMSource> scmSources, Map<String,Object> attributes, TaskListener listener)
protected abstract MultiBranchProject<?,?>
doCreateProject(ItemGroup<?> parent, String name, Map<String,Object> attributes)
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
-
-
-
-
Method Detail
-
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, InterruptedException
Historical 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, InterruptedException
Creates 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, InterruptedException
Determines 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, InterruptedException
Determines 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.
-
-