Package jenkins.scm.api
Class SCMHeadObserver.Filter<O extends SCMHeadObserver>
- java.lang.Object
-
- jenkins.scm.api.SCMHeadObserver
-
- jenkins.scm.api.SCMHeadObserver.Wrapped<O>
-
- jenkins.scm.api.SCMHeadObserver.Filter<O>
-
- Type Parameters:
O
- the type of wrappedSCMHeadObserver
- Enclosing class:
- SCMHeadObserver
public static class SCMHeadObserver.Filter<O extends SCMHeadObserver> extends SCMHeadObserver.Wrapped<O>
ASCMHeadObserver
that filters theSCMHead
instances that will be observed by the wrappedSCMHeadObserver
.- Since:
- 2.0
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class jenkins.scm.api.SCMHeadObserver
SCMHeadObserver.AllFinished, SCMHeadObserver.Any, SCMHeadObserver.Collector, SCMHeadObserver.Filter<O extends SCMHeadObserver>, SCMHeadObserver.Named, SCMHeadObserver.None, SCMHeadObserver.OneFinished, SCMHeadObserver.Selector, SCMHeadObserver.Wrapped<O extends SCMHeadObserver>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<SCMHead>
getIncludes()
boolean
isObserving()
Returns information about whether the observer wants more results.void
observe(SCMHead head, SCMRevision revision)
Observes a head and current revision.-
Methods inherited from class jenkins.scm.api.SCMHeadObserver.Wrapped
unwrap
-
-
-
-
Constructor Detail
-
Filter
public Filter(O delegate, SCMHead... heads)
Constructor.- Parameters:
delegate
- TheSCMHeadObserver
to wrap.heads
- TheSCMHead
instances that my be observed by the wrappedSCMHeadObserver
.
-
-
Method Detail
-
observe
public void observe(@NonNull SCMHead head, @NonNull SCMRevision revision) throws IOException, InterruptedException
Observes a head and current revision.- Overrides:
observe
in classSCMHeadObserver.Wrapped<O extends SCMHeadObserver>
- Parameters:
head
- the head.revision
- the revision.- Throws:
IOException
- if processing of the observation could not be completed due to anIOException
.InterruptedException
- if processing of the observation was interrupted
-
isObserving
public boolean isObserving()
Returns information about whether the observer wants more results.- Overrides:
isObserving
in classSCMHeadObserver.Wrapped<O extends SCMHeadObserver>
- Returns:
true
if the observer is still observing orfalse
to signal that it is ok to stop early.
-
getIncludes
public Set<SCMHead> getIncludes()
Returns the subset ofSCMHead
instances that this observer is interested in ornull
if interested in allSCMHead
instances.Implementations should not assume that the
SCMHeadObserver.getIncludes()
will be honoured. This method is designed to provide a hint toSCMSource
implementations.- Overrides:
getIncludes
in classSCMHeadObserver.Wrapped<O extends SCMHeadObserver>
- Returns:
- the subset of
SCMHead
instances that this observer is interested in ornull
.
-
-