Package jenkins.scm.api
Class SCMSourceObserver.Wrapped<O extends SCMSourceObserver>
java.lang.Object
jenkins.scm.api.SCMSourceObserver
jenkins.scm.api.SCMSourceObserver.Wrapped<O>
- Type Parameters:
O- the class of wrapped observer.
- Direct Known Subclasses:
SCMSourceObserver.Filter
- Enclosing class:
- SCMSourceObserver
public abstract static class SCMSourceObserver.Wrapped<O extends SCMSourceObserver>
extends SCMSourceObserver
Base class for an observer that wraps another observer.
-
Nested Class Summary
Nested classes/interfaces inherited from class jenkins.scm.api.SCMSourceObserver
SCMSourceObserver.Filter<O extends SCMSourceObserver>, SCMSourceObserver.ProjectObserver, SCMSourceObserver.Wrapped<O extends SCMSourceObserver> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttribute(String key, Object value) Adds extra metadata about the overall organization.Indicates who is asking for sources.Returns the subset of "project" names that this observer is interested in ornullif interested in all "project" names.Provides a way of reporting progress.booleanReturns information about whether the observer wants more results.Declare that a new "project" such as a source repository has been found.Methods inherited from class jenkins.scm.api.SCMSourceObserver
filter
-
Constructor Details
-
Wrapped
Constructor.- Parameters:
delegate- the observer to delegate to.
-
-
Method Details
-
getContext
Indicates who is asking for sources.- Specified by:
getContextin classSCMSourceObserver- Returns:
- a contextual item, typically a
OrganizationFolder
-
getListener
Provides a way of reporting progress.- Specified by:
getListenerin classSCMSourceObserver- Returns:
- a logger
-
getIncludes
Returns the subset of "project" names that this observer is interested in ornullif interested in all "project" names.Implementations should not assume that the
SCMSourceObserver.getIncludes()will be honoured. This method is designed to provide a hint toSCMNavigatorimplementations.- Overrides:
getIncludesin classSCMSourceObserver- Returns:
- the subset of "project" names that this observer is interested in or
null. - See Also:
-
observe
@NonNull public SCMSourceObserver.ProjectObserver observe(@NonNull String projectName) throws IllegalArgumentException, IOException, InterruptedException Declare that a new "project" such as a source repository has been found.- Specified by:
observein classSCMSourceObserver- Parameters:
projectName- a name of the project, such as a repository name within an organization; may be used as anItem.getName()- Returns:
- a secondary callback to customize the project, on which you must call
SCMSourceObserver.ProjectObserver.complete() - Throws:
IllegalArgumentException- if thisprojectNamehas already been encounteredIOException- if observing thisprojectNamecould not be completed due to anIOException.InterruptedException- if observing thisprojectNamewas interrupted.
-
addAttribute
public void addAttribute(@NonNull String key, @Nullable Object value) throws IllegalArgumentException, ClassCastException Adds extra metadata about the overall organization. Currently no metadata keys are defined; placeholder for description, icon, URL, etc.- Specified by:
addAttributein classSCMSourceObserver- 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
-
isObserving
public boolean isObserving()Returns information about whether the observer wants more results.- Overrides:
isObservingin classSCMSourceObserver- Returns:
trueif the observer is still observing orfalseto signal that it is ok to stop early.
-