public abstract class SCMSourceObserver extends Object
SCMNavigator.| Modifier and Type | Class and Description |
|---|---|
static class |
SCMSourceObserver.Filter<O extends SCMSourceObserver>
An observer that filters the observed sources to a subset of named instances.
|
static class |
SCMSourceObserver.ProjectObserver
Nested callback produced by
observe(java.lang.String). |
static class |
SCMSourceObserver.Wrapped<O extends SCMSourceObserver>
Base class for an observer that wraps another observer.
|
| Constructor and Description |
|---|
SCMSourceObserver() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
addAttribute(String key,
Object value)
Adds extra metadata about the overall organization.
|
static <O extends SCMSourceObserver> |
filter(O delegate,
String... projectNames)
Creates an observer that filters a delegates observer to the specified project names
|
abstract SCMSourceOwner |
getContext()
Indicates who is asking for sources.
|
Set<String> |
getIncludes()
Returns the subset of "project" names that this observer is interested in or
null if
interested in all "project" names. |
abstract TaskListener |
getListener()
Provides a way of reporting progress.
|
boolean |
isObserving()
Returns information about whether the observer wants more results.
|
abstract SCMSourceObserver.ProjectObserver |
observe(String projectName)
Declare that a new “project” such as a source repository has been found.
|
@NonNull public abstract SCMSourceOwner getContext()
OrganizationFolder@NonNull public abstract TaskListener getListener()
@CheckForNull public Set<String> getIncludes()
null if
interested in all "project" names.
Implementations should not assume that the getIncludes() will be honoured.
This method is designed to provide a hint to SCMNavigator implementations.
null.for the definition of "project" names@NonNull public abstract SCMSourceObserver.ProjectObserver observe(@NonNull String projectName) throws IllegalArgumentException, IOException, InterruptedException
projectName - a name of the project, such as a repository name within an organization; may be used as an
Item.getName()SCMSourceObserver.ProjectObserver.complete()IllegalArgumentException - if this projectName has already been encounteredIOException - if observing this projectName could not be completed due to an IOException.InterruptedException - if observing this projectName was interrupted.public abstract void addAttribute(@NonNull
String key,
@Nullable
Object value)
throws IllegalArgumentException,
ClassCastException
key - a predefined attribute namevalue - some value, of a type defined by the attribute, perhaps null if allowed by the attribute
documentationIllegalArgumentException - if the attribute name is unrecognized, or this attribute was already addedClassCastException - if the attribute value is inappropriate for its typepublic boolean isObserving()
true if the observer is still observing or false to signal that it is ok to stop early.@NonNull public static <O extends SCMSourceObserver> SCMSourceObserver.Filter<O> filter(O delegate, String... projectNames)
O - the type of observer that will be filtered.delegate - the delegateprojectNames - the project names to watch out for.Copyright © 2016–2019. All rights reserved.