Class SCMSourceObserver

    • Constructor Detail

      • SCMSourceObserver

        public SCMSourceObserver()
    • Method Detail

      • getContext

        @NonNull
        public abstract SCMSourceOwner getContext()
        Indicates who is asking for sources.
        Returns:
        a contextual item, typically a OrganizationFolder
      • getListener

        @NonNull
        public abstract TaskListener getListener()
        Provides a way of reporting progress.
        Returns:
        a logger
      • getIncludes

        @CheckForNull
        public Set<String> getIncludes()
        Returns the subset of "project" names that this observer is interested in or 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.

        Returns:
        the subset of "project" names that this observer is interested in or null.
        Since:
        2.0
        See Also:
        for the definition of "project" names
      • addAttribute

        public abstract 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.
        Parameters:
        key - a predefined attribute name
        value - 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 added
        ClassCastException - if the attribute value is inappropriate for its type
      • isObserving

        public boolean isObserving()
        Returns information about whether the observer wants more results.
        Returns:
        true if the observer is still observing or false to signal that it is ok to stop early.
        Since:
        2.0
      • filter

        @NonNull
        public static <O extends SCMSourceObserverSCMSourceObserver.Filter<O> filter​(O delegate,
                                                                                       String... projectNames)
        Creates an observer that filters a delegates observer to the specified project names
        Type Parameters:
        O - the type of observer that will be filtered.
        Parameters:
        delegate - the delegate
        projectNames - the project names to watch out for.
        Returns:
        an observer that wraps the supplied delegate.
        Since:
        2.0