Class SCMNavigator
- All Implemented Interfaces:
- ExtensionPoint,- Describable<SCMNavigator>
- Direct Known Subclasses:
- SingleSCMNavigator
SCMSources within an organization.
 An implementation does not need to cache existing discoveries, but some form of caching is strongly recommended
 where the backing provider of repositories has a rate limiter on API calls.- Since:
- 0.3-beta-1
- 
Nested Class SummaryNested classes/interfaces inherited from interface hudson.ExtensionPointExtensionPoint.LegacyInstancesAreScopedToHudson
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final AlternativeUiTextProvider.Message<SCMNavigator>Replaceable pronoun of that points to aSCMNavigator.
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidafterSave(SCMNavigatorOwner owner) Callback from theSCMNavigatorOwnerafter theSCMNavigatorOwnerhas been saved.protected final voidChecks theThread.interrupted()and throws anInterruptedExceptionif it was set.protected final TaskListenerdefaultListener(TaskListener listener) Turns a possiblynullTaskListenerreference into a guaranteed non-null reference.fetchActions(SCMNavigatorOwner owner, SCMNavigatorEvent event, TaskListener listener) Fetches any actions that should be persisted for objects related to the specified owner.final Set<? extends SCMSourceCategory>Returns the set ofSCMSourceCategorythat thisSCMNavigatorsupports.final StringgetId()Returns the ID of the thing being navigated.Get the term used in the UI to represent this kind ofSCMNavigator.Gets the traits for this navigator.protected abstract Stringid()Generates the ID of the thing being navigated from the configuration of thisSCMNavigator.protected booleanisCategoryEnabled(SCMSourceCategory category) Sub-classes can override this method to filter the categories that are available from a specific source.protected final voidresetId()retrieveActions(SCMNavigatorOwner owner, SCMNavigatorEvent event, TaskListener listener) voidSets the traits for this navigator.voidvisitSource(String sourceName, SCMSourceObserver observer) Looks for the named SCM source in a configured place.abstract voidvisitSources(SCMSourceObserver observer) Looks for SCM sources in a configured place.voidvisitSources(SCMSourceObserver observer, SCMHeadEvent<?> event) Looks for SCM sources in a configured place (scoped against a specific event).voidvisitSources(SCMSourceObserver observer, SCMSourceEvent<?> event) Looks for SCM sources in a configured place (scoped against a specific event).
- 
Field Details- 
PRONOUNReplaceable pronoun of that points to aSCMNavigator. Defaults tonulldepending on the context.- Since:
- 2.0
 
 
- 
- 
Constructor Details- 
SCMNavigatorprotected SCMNavigator()Constructor.
 
- 
- 
Method Details- 
getIdReturns the ID of the thing being navigated.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 SCMNavigatorOwnerthen the results fromfetchActions(SCMNavigatorOwner, SCMNavigatorEvent, TaskListener)should be not just equivalent butList.equals(Object).- Returns:
- the ID of the thing being navigated by this navigator.
- Since:
- 2.0.1
- See Also:
 
- 
resetIdprotected final void resetId()If implementations are usingDataBoundSetteron fields that affect theid()calculation then those fields must callresetId()if they may have invalidated the cachedgetId().- Since:
- 2.0.1
 
- 
idGenerates the ID of the thing being navigated from the configuration of thisSCMNavigator.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 SCMNavigatorOwnerthen the results fromfetchActions(SCMNavigatorOwner, SCMNavigatorEvent, TaskListener)should be not just equivalent butList.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. 
- 
setTraitsSets the traits for this navigator. No-op by default.- Parameters:
- traits- the list of traits
 
- 
getTraitsGets the traits for this navigator.- Returns:
- traits the list of traits, empty by default.
 
- 
visitSourcespublic abstract void visitSources(@NonNull SCMSourceObserver observer) throws IOException, InterruptedException Looks for SCM sources in a configured place. After this method completes, no further calls may be made to theobserveror its child callbacks. It is vitally important that implementations must periodically callcheckInterrupt()otherwise it will be impossible for users to interrupt the operation.- Parameters:
- observer- a recipient of progress notifications and a source of contextual information
- Throws:
- IOException- if scanning fails
- InterruptedException- if scanning is interrupted
 
- 
visitSourcespublic void visitSources(@NonNull SCMSourceObserver observer, @NonNull SCMSourceEvent<?> event) throws IOException, InterruptedException Looks for SCM sources in a configured place (scoped against a specific event). After this method completes, no further calls may be made to theobserveror its child callbacks. It is vitally important that implementations must periodically callcheckInterrupt()otherwise it will be impossible for users to interrupt the operation.- Parameters:
- observer- a recipient of progress notifications and a source of contextual information
- event- the event from which the operation should be scoped.
- Throws:
- IOException- if scanning fails
- InterruptedException- if scanning is interrupted
- Since:
- 2.0
 
- 
visitSourcespublic void visitSources(@NonNull SCMSourceObserver observer, @NonNull SCMHeadEvent<?> event) throws IOException, InterruptedException Looks for SCM sources in a configured place (scoped against a specific event). After this method completes, no further calls may be made to theobserveror its child callbacks. It is vitally important that implementations must periodically callcheckInterrupt()otherwise it will be impossible for users to interrupt the operation.- Parameters:
- observer- a recipient of progress notifications and a source of contextual information
- event- the event from which the operation should be scoped.
- Throws:
- IOException- if scanning fails
- InterruptedException- if scanning is interrupted
- Since:
- 2.0
 
- 
visitSourcepublic void visitSource(@NonNull String sourceName, @NonNull SCMSourceObserver observer) throws IOException, InterruptedException Looks for the named SCM source in a configured place. Implementers must ensure that after this method completes, no further calls may be made to theobserveror its child callbacks. Implementations are strongly encouraged to override this method.- Parameters:
- sourceName- the source to visit.
- observer- a recipient of progress notifications and a source of contextual information
- Throws:
- IOException- if scanning fails
- InterruptedException- if scanning is interrupted
- Since:
- 2.0
 
- 
getCategoriesReturns the set ofSCMSourceCategorythat thisSCMNavigatorsupports. There will always be exactly oneSCMCategory.isUncategorized()instance in the returned set.- Returns:
- the set of SCMSourceCategorythat thisSCMNavigatorsupports.
- Since:
- 2.0
 
- 
isCategoryEnabledSub-classes can override this method to filter the categories that are available from a specific source. For example a source type might be capable of having mainline branches, user branches, merge requests and release tags while a specific instance of the source may be configured to only have mainline branches and release tags.- Parameters:
- category- the category.
- Returns:
- trueif the supplied category is enabled for this- SCMNavigatorinstance.
- Since:
- 2.0
 
- 
getDescriptor- Specified by:
- getDescriptorin interface- Describable<SCMNavigator>
- Overrides:
- getDescriptorin class- AbstractDescribableImpl<SCMNavigator>
 
- 
getPronounGet the term used in the UI to represent this kind ofSCMNavigator. Must start with a capital letter.- Returns:
- the term or nullto fall back to the calling context's default.
- Since:
- 2.0
 
- 
defaultListenerTurns a possiblynullTaskListenerreference into a guaranteed non-null reference.- Parameters:
- listener- a possibly- null- TaskListenerreference.
- Returns:
- guaranteed non-null TaskListener.
 
- 
checkInterruptChecks theThread.interrupted()and throws anInterruptedExceptionif it was set.- Throws:
- InterruptedException- if interrupted.
- Since:
- 2.0
 
 
-