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
-
Method Summary
Modifier and TypeMethodDescriptionReturns the subset of "project" names that this observer is interested in ornull
if interested in all "project" names.boolean
Returns 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, getListener
Methods 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 ornull
if interested in all "project" names.Implementations should not assume that the
SCMSourceObserver.getIncludes()
will be honoured. This method is designed to provide a hint toSCMNavigator
implementations.- Overrides:
getIncludes
in 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:
observe
in 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 thisprojectName
has already been encounteredIOException
- if observing thisprojectName
could not be completed due to anIOException
.InterruptedException
- if observing thisprojectName
was interrupted.
-
isObserving
public boolean isObserving()Returns information about whether the observer wants more results.- Overrides:
isObserving
in classSCMSourceObserver.Wrapped<O extends SCMSourceObserver>
- Returns:
true
if the observer is still observing orfalse
to signal that it is ok to stop early.
-