Class GitHubSCMNavigator
java.lang.Object
hudson.model.AbstractDescribableImpl<jenkins.scm.api.SCMNavigator>
jenkins.scm.api.SCMNavigator
org.jenkinsci.plugins.github_branch_source.GitHubSCMNavigator
- All Implemented Interfaces:
ExtensionPoint,Describable<jenkins.scm.api.SCMNavigator>
public class GitHubSCMNavigator
extends jenkins.scm.api.SCMNavigator
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class jenkins.scm.api.SCMNavigator
PRONOUN -
Constructor Summary
ConstructorsConstructorDescriptionGitHubSCMNavigator(String repoOwner) Constructor.GitHubSCMNavigator(String apiUri, String repoOwner, String scanCredentialsId, String checkoutCredentialsId) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidafterSave(jenkins.scm.api.SCMNavigatorOwner owner) Gets the API endpoint for the GitHub server.booleanDeprecated.booleanDeprecated.booleanDeprecated.booleanDeprecated.booleanDeprecated.booleanDeprecated.Deprecated.useSSHCheckoutTraitGets theIdCredentials.getId()of the credentials to use when accessingapiUri(and also the default credentials to use for checking out).Deprecated.useWildcardSCMHeadFilterTrait.Deprecated.useWildcardSCMHeadFilterTrait.Deprecated.useRegexSCMSourceFilterTraitGets the name of the owner who's repositories will be navigated.Deprecated.usegetCredentialsId().List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>>Gets the behavioural traits that are applied to this navigator and anyGitHubSCMSourceinstances it discovers.protected Stringid()static voidbooleanReturn if the avatar retrieval is enabled.retrieveActions(jenkins.scm.api.SCMNavigatorOwner owner, jenkins.scm.api.SCMNavigatorEvent event, TaskListener listener) voidSets the API endpoint for the GitHub server.voidsetBuildForkPRHead(boolean buildForkPRHead) Deprecated.voidsetBuildForkPRMerge(boolean buildForkPRMerge) Deprecated.voidsetBuildOriginBranch(boolean buildOriginBranch) Deprecated.voidsetBuildOriginBranchWithPR(boolean buildOriginBranchWithPR) Deprecated.voidsetBuildOriginPRHead(boolean buildOriginPRHead) Deprecated.voidsetBuildOriginPRMerge(boolean buildOriginPRMerge) Deprecated.voidsetCredentialsId(String credentialsId) Sets theIdCredentials.getId()of the credentials to use when accessingapiUri(and also the default credentials to use for checking out).voidsetEnableAvatar(boolean enableAvatar) Enable retrieval of the organization avatar.voidsetExcludes(String excludes) Deprecated.useWildcardSCMHeadFilterTrait.voidsetIncludes(String includes) Deprecated.useWildcardSCMHeadFilterTrait.voidsetPattern(String pattern) Deprecated.useRegexSCMSourceFilterTraitvoidsetScanCredentialsId(String scanCredentialsId) Deprecated.voidSets the behavioural traits that are applied to this navigator and anyGitHubSCMSourceinstances it discovers.voidsetTraits(jenkins.scm.api.trait.SCMTrait[] traits) Sets the behavioural traits that are applied to this navigator and anyGitHubSCMSourceinstances it discovers.voidvisitSource(String sourceName, jenkins.scm.api.SCMSourceObserver observer) voidvisitSources(jenkins.scm.api.SCMSourceObserver observer) Methods inherited from class jenkins.scm.api.SCMNavigator
checkInterrupt, defaultListener, fetchActions, getCategories, getDescriptor, getId, getPronoun, isCategoryEnabled, resetId, visitSources, visitSources
-
Constructor Details
-
GitHubSCMNavigator
Constructor.- Parameters:
repoOwner- the owner of the repositories to navigate.- Since:
- 2.2.0
-
GitHubSCMNavigator
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public GitHubSCMNavigator(String apiUri, String repoOwner, String scanCredentialsId, String checkoutCredentialsId) Deprecated.Legacy constructor.- Parameters:
apiUri- the API endpoint for the GitHub server.repoOwner- the owner of the repositories to navigate.scanCredentialsId- the credentials to use when accessingapiUri(and also the default credentials to use for checking out).checkoutCredentialsId- the credentials to use when checking out.
-
-
Method Details
-
getApiUri
Gets the API endpoint for the GitHub server.- Returns:
- the API endpoint for the GitHub server.
-
setApiUri
Sets the API endpoint for the GitHub server.- Parameters:
apiUri- the API endpoint for the GitHub server.- Since:
- 2.2.0
-
getCredentialsId
Gets theIdCredentials.getId()of the credentials to use when accessingapiUri(and also the default credentials to use for checking out).- Returns:
- the
IdCredentials.getId()of the credentials to use when accessingapiUri(and also the default credentials to use for checking out). - Since:
- 2.2.0
-
setCredentialsId
Sets theIdCredentials.getId()of the credentials to use when accessingapiUri(and also the default credentials to use for checking out).- Parameters:
credentialsId- theIdCredentials.getId()of the credentials to use when accessingapiUri(and also the default credentials to use for checking out).- Since:
- 2.2.0
-
isEnableAvatar
@NonNull public boolean isEnableAvatar()Return if the avatar retrieval is enabled.- Returns:
- true is enabled, false otherwise
-
setEnableAvatar
@DataBoundSetter public void setEnableAvatar(boolean enableAvatar) Enable retrieval of the organization avatar.- Parameters:
enableAvatar- true to enable, false to disable
-
getRepoOwner
Gets the name of the owner who's repositories will be navigated.- Returns:
- the name of the owner who's repositories will be navigated.
-
getTraits
@NonNull public List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>> getTraits()Gets the behavioural traits that are applied to this navigator and anyGitHubSCMSourceinstances it discovers.- Overrides:
getTraitsin classjenkins.scm.api.SCMNavigator- Returns:
- the behavioural traits.
-
setTraits
@DataBoundSetter public void setTraits(@CheckForNull jenkins.scm.api.trait.SCMTrait[] traits) Sets the behavioural traits that are applied to this navigator and anyGitHubSCMSourceinstances it discovers. The new traits will take affect on the next navigation through any of thevisitSources(SCMSourceObserver)overloads orvisitSource(String, SCMSourceObserver).- Parameters:
traits- the new behavioural traits.
-
setTraits
public void setTraits(@CheckForNull List<jenkins.scm.api.trait.SCMTrait<? extends jenkins.scm.api.trait.SCMTrait<?>>> traits) Sets the behavioural traits that are applied to this navigator and anyGitHubSCMSourceinstances it discovers. The new traits will take affect on the next navigation through any of thevisitSources(SCMSourceObserver)overloads orvisitSource(String, SCMSourceObserver).- Overrides:
setTraitsin classjenkins.scm.api.SCMNavigator- Parameters:
traits- the new behavioural traits.
-
getScanCredentialsId
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @CheckForNull public String getScanCredentialsId()Deprecated.usegetCredentialsId().Legacy getter.- Returns:
getCredentialsId().
-
setScanCredentialsId
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setScanCredentialsId(@CheckForNull String scanCredentialsId) Deprecated.Legacy setter.- Parameters:
scanCredentialsId- the credentials.
-
getIncludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @NonNull public String getIncludes()Deprecated.useWildcardSCMHeadFilterTrait.Legacy getter.- Returns:
WildcardSCMHeadFilterTrait.getIncludes()
-
getExcludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @NonNull public String getExcludes()Deprecated.useWildcardSCMHeadFilterTrait.Legacy getter.- Returns:
WildcardSCMHeadFilterTrait.getExcludes()
-
setIncludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setIncludes(@NonNull String includes) Deprecated.useWildcardSCMHeadFilterTrait.Legacy setter.- Parameters:
includes- seeWildcardSCMHeadFilterTrait(String, String)
-
setExcludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setExcludes(@NonNull String excludes) Deprecated.useWildcardSCMHeadFilterTrait.Legacy setter.- Parameters:
excludes- seeWildcardSCMHeadFilterTrait(String, String)
-
getBuildOriginBranch
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginBranch()Deprecated.Legacy getter.- Returns:
BranchDiscoveryTrait.isBuildBranch().
-
setBuildOriginBranch
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginBranch(boolean buildOriginBranch) Deprecated.Legacy setter.- Parameters:
buildOriginBranch- seeBranchDiscoveryTrait(boolean, boolean).
-
getBuildOriginBranchWithPR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginBranchWithPR()Deprecated.Legacy getter. -
setBuildOriginBranchWithPR
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginBranchWithPR(boolean buildOriginBranchWithPR) Deprecated.Legacy setter.- Parameters:
buildOriginBranchWithPR- seeBranchDiscoveryTrait(boolean, boolean).
-
getBuildOriginPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginPRMerge()Deprecated.Legacy getter. -
setBuildOriginPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginPRMerge(boolean buildOriginPRMerge) Deprecated.Legacy setter.- Parameters:
buildOriginPRMerge- seeOriginPullRequestDiscoveryTrait(Set).
-
getBuildOriginPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildOriginPRHead()Deprecated.Legacy getter. -
setBuildOriginPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildOriginPRHead(boolean buildOriginPRHead) Deprecated.Legacy setter.- Parameters:
buildOriginPRHead- seeOriginPullRequestDiscoveryTrait(Set).
-
getBuildForkPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildForkPRMerge()Deprecated.Legacy getter. -
setBuildForkPRMerge
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildForkPRMerge(boolean buildForkPRMerge) Deprecated.Legacy setter.- Parameters:
buildForkPRMerge- seeForkPullRequestDiscoveryTrait(Set, SCMHeadAuthority).
-
getBuildForkPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public boolean getBuildForkPRHead()Deprecated.Legacy getter. -
setBuildForkPRHead
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBuildForkPRHead(boolean buildForkPRHead) Deprecated.Legacy setter.- Parameters:
buildForkPRHead- seeForkPullRequestDiscoveryTrait(Set, SCMHeadAuthority).
-
getCheckoutCredentialsId
@CheckForNull @Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public String getCheckoutCredentialsId()Deprecated.useSSHCheckoutTraitLegacy getter.- Returns:
SSHCheckoutTrait.getCredentialsId()with some mangling to preserve legacy behaviour.
-
getPattern
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") public String getPattern()Deprecated.useRegexSCMSourceFilterTraitLegacy getter.- Returns:
RegexSCMSourceFilterTrait.getRegex().
-
setPattern
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.DoNotUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setPattern(String pattern) Deprecated.useRegexSCMSourceFilterTraitLegacy setter.- Parameters:
pattern- seeRegexSCMSourceFilterTrait(String).
-
id
- Specified by:
idin classjenkins.scm.api.SCMNavigator
-
visitSources
public void visitSources(jenkins.scm.api.SCMSourceObserver observer) throws IOException, InterruptedException - Specified by:
visitSourcesin classjenkins.scm.api.SCMNavigator- Throws:
IOExceptionInterruptedException
-
visitSource
public void visitSource(String sourceName, jenkins.scm.api.SCMSourceObserver observer) throws IOException, InterruptedException - Overrides:
visitSourcein classjenkins.scm.api.SCMNavigator- Throws:
IOExceptionInterruptedException
-
invalidatePrivateModeCache
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @Initializer(after=JOB_CONFIG_ADAPTED) public static void invalidatePrivateModeCache()
-
GitHubSCMNavigator(String),setApiUri(String),setCredentialsId(String)andSSHCheckoutTrait