Package jenkins.scm.impl
Class NoOpProjectObserver
java.lang.Object
jenkins.scm.api.SCMSourceObserver.ProjectObserver
jenkins.scm.impl.NoOpProjectObserver
A
SCMSourceObserver.ProjectObserver
that does nothing.- Since:
- 2.0
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAttribute
(String key, Object value) Adds extra metadata about a specific project.void
Adds a source repository to be used from a new project.void
complete()
To be called when finished defining one project.static NoOpProjectObserver
instance()
Returns the singleton instance.
-
Constructor Details
-
NoOpProjectObserver
public NoOpProjectObserver()
-
-
Method Details
-
instance
Returns the singleton instance.- Returns:
- the singleton instance.
-
addSource
Adds a source repository to be used from a new project.- Specified by:
addSource
in classSCMSourceObserver.ProjectObserver
- Parameters:
source
- a potential SCM source as inMultiBranchProject.getSCMSources
; do not callSCMSource.setOwner(jenkins.scm.api.SCMSourceOwner)
on it
-
addAttribute
public 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.- Specified by:
addAttribute
in classSCMSourceObserver.ProjectObserver
- 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.- Specified by:
complete
in classSCMSourceObserver.ProjectObserver
- Throws:
IllegalStateException
- may be thrown if called twiceInterruptedException
- if processing of the final project was interrupted
-