Package jenkins.scm.api
Class SCMSourceObserver.Filter<O extends SCMSourceObserver>
java.lang.Object
jenkins.scm.api.SCMSourceObserver
jenkins.scm.api.SCMSourceObserver.Wrapped<O>
jenkins.scm.api.SCMSourceObserver.Filter<O>
- Type Parameters:
O- the type of observer being filtered.
- Enclosing class:
- SCMSourceObserver
public static class SCMSourceObserver.Filter<O extends SCMSourceObserver>
extends SCMSourceObserver.Wrapped<O>
An observer that filters the observed sources to a subset of named instances.
- Since:
- 2.0
-
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 TypeMethodDescriptionReturns the subset of "project" names that this observer is interested in ornullif interested in all "project" names.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.Wrapped
addAttribute, getContext, getListenerMethods inherited from class jenkins.scm.api.SCMSourceObserver
filter
-
Constructor Details
-
Filter
Constructor.- Parameters:
delegate- the delegate.projectNames- the project names to filter.
-
-
Method Details
-
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.Wrapped<O extends SCMSourceObserver>- 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.- Overrides:
observein classSCMSourceObserver.Wrapped<O extends SCMSourceObserver>- 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.
-
isObserving
public boolean isObserving()Returns information about whether the observer wants more results.- Overrides:
isObservingin classSCMSourceObserver.Wrapped<O extends SCMSourceObserver>- Returns:
trueif the observer is still observing orfalseto signal that it is ok to stop early.
-