Package jenkins.scm.api
Class SCMSourceObserver.ProjectObserver
java.lang.Object
jenkins.scm.api.SCMSourceObserver.ProjectObserver
- Direct Known Subclasses:
NoOpProjectObserver
- Enclosing class:
- SCMSourceObserver
Nested callback produced by
SCMSourceObserver.observe(java.lang.String)
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
addAttribute
(String key, Object value) Adds extra metadata about a specific project.abstract void
Adds a source repository to be used from a new project.abstract void
complete()
To be called when finished defining one project.
-
Constructor Details
-
ProjectObserver
public ProjectObserver()
-
-
Method Details
-
addSource
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
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
-