Package jenkins.scm.api
Class SCMSourceObserver.ProjectObserver
- java.lang.Object
-
- jenkins.scm.api.SCMSourceObserver.ProjectObserver
-
- Direct Known Subclasses:
NoOpProjectObserver
- Enclosing class:
- SCMSourceObserver
public abstract static class SCMSourceObserver.ProjectObserver extends Object
Nested callback produced bySCMSourceObserver.observe(java.lang.String)
.
-
-
Constructor Summary
Constructors Constructor Description ProjectObserver()
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description abstract void
addAttribute(String key, Object value)
Adds extra metadata about a specific project.abstract void
addSource(SCMSource source)
Adds a source repository to be used from a new project.abstract void
complete()
To be called when finished defining one project.
-
-
-
Method Detail
-
addSource
public abstract void addSource(@NonNull SCMSource source)
Adds a source repository to be used from a new project.- Parameters:
source
- a potential SCM source as inMultiBranchProject.getSCMSources
; do not callSCMSource.setOwner(jenkins.scm.api.SCMSourceOwner)
on it
-
addAttribute
public abstract void addAttribute(@NonNull String key, @Nullable Object value) throws IllegalArgumentException, ClassCastException
Adds extra metadata about a specific project. Currently no metadata keys are defined; placeholder for description, icon, URL, etc.- Parameters:
key
- a predefined attribute namevalue
- some value, of a type defined by the attribute, perhaps null if allowed by the attribute documentation- Throws:
IllegalArgumentException
- if the attribute name is unrecognized, or this attribute was already addedClassCastException
- if the attribute value is inappropriate for its type
-
complete
public abstract void complete() throws IllegalStateException, IOException, InterruptedException
To be called when finished defining one project.- Throws:
IllegalStateException
- may be thrown if called twiceIOException
- if processing of the final project could not be completed due to anIOException
.InterruptedException
- if processing of the final project was interrupted
-
-