Class SingleSCMNavigator

  • All Implemented Interfaces:
    ExtensionPoint, Describable<SCMNavigator>

    @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
    public class SingleSCMNavigator
    extends SCMNavigator
    Degenerate navigator which only ever returns a single repository.
    • Constructor Detail

      • SingleSCMNavigator

        @DataBoundConstructor
        public SingleSCMNavigator​(String name,
                                  List<SCMSource> sources)
    • Method Detail

      • getName

        public String getName()
      • id

        @NonNull
        protected String id()
        Description copied from class: SCMNavigator
        Generates the ID of the thing being navigated from the configuration of this SCMNavigator.

        The ID will typically be a composite of things like the server and the project/organization that the navigator is scoped to.

        For example, a GitHub navigator that is navigating repositories in a GitHub organization could construct its ID as being the URL of the GitHub Server (to allow for GitHub Enterprise servers) and the name of the organization.

        The key criteria is that if two navigators have the same ID and they are both in the same SCMNavigatorOwner then the results from SCMNavigator.fetchActions(SCMNavigatorOwner, SCMNavigatorEvent, TaskListener) should be not just equivalent but List.equals(Object).

        If the results could be non-equal for navigators with the same ID then more detail needs to be encoded in the ID.

        Specified by:
        id in class SCMNavigator
        Returns:
        the ID of the thing being navigated by this navigator.
        See Also:
        SCMNavigator.resetId(), SCMNavigator.getId()
      • visitSources

        public void visitSources​(@NonNull
                                 SCMSourceObserver observer)
                          throws IOException,
                                 InterruptedException
        Description copied from class: SCMNavigator
        Looks for SCM sources in a configured place. After this method completes, no further calls may be made to the observer or its child callbacks. It is vitally important that implementations must periodically call SCMNavigator.checkInterrupt() otherwise it will be impossible for users to interrupt the operation.
        Specified by:
        visitSources in class SCMNavigator
        Parameters:
        observer - a recipient of progress notifications and a source of contextual information
        Throws:
        IOException - if scanning fails
        InterruptedException - if scanning is interrupted