Class GerritSCMFileSystem.BuilderImpl

java.lang.Object
jenkins.scm.api.SCMFileSystem.Builder
io.jenkins.plugins.gerritlightweight.GerritSCMFileSystem.BuilderImpl
All Implemented Interfaces:
ExtensionPoint
Enclosing class:
GerritSCMFileSystem

@Extension(ordinal=100.0) public static final class GerritSCMFileSystem.BuilderImpl extends jenkins.scm.api.SCMFileSystem.Builder
Selects REST retrieval for Git SCMs explicitly configured with GerritRestCheckout. The extension ordinal gives this builder priority over the default Git provider. SCM source discovery is unsupported.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface hudson.ExtensionPoint

    ExtensionPoint.LegacyInstancesAreScopedToHudson
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    jenkins.scm.api.SCMFileSystem
    build(Item owner, SCM scm, jenkins.scm.api.SCMRevision revision)
    Builds a REST filesystem without a build environment for variable expansion.
    jenkins.scm.api.SCMFileSystem
    build(Item owner, SCM scm, jenkins.scm.api.SCMRevision revision, Run<?,?> run)
    Builds a fixed REST filesystem using job-scoped HTTP credentials.
    boolean
    Checks whether a Git SCM explicitly enables this REST provider.
    boolean
    supports(jenkins.scm.api.SCMSource source)
    Reports that this builder does not directly support SCM sources.
    protected boolean
    Identifies Git SCM descriptors as potentially supported; individual jobs must opt in.
    protected boolean
    supportsDescriptor(jenkins.scm.api.SCMSourceDescriptor descriptor)
    Reports that SCM source descriptors are unsupported.

    Methods inherited from class jenkins.scm.api.SCMFileSystem.Builder

    build, supports, supports

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BuilderImpl

      public BuilderImpl()
  • Method Details

    • supports

      public boolean supports(SCM scm)
      Checks whether a Git SCM explicitly enables this REST provider.
      Specified by:
      supports in class jenkins.scm.api.SCMFileSystem.Builder
      Parameters:
      scm - SCM configuration to inspect
      Returns:
      whether the Gerrit REST behavior is present
    • supports

      public boolean supports(jenkins.scm.api.SCMSource source)
      Reports that this builder does not directly support SCM sources.
      Specified by:
      supports in class jenkins.scm.api.SCMFileSystem.Builder
      Parameters:
      source - SCM source to inspect
      Returns:
      false
    • supportsDescriptor

      protected boolean supportsDescriptor(SCMDescriptor descriptor)
      Identifies Git SCM descriptors as potentially supported; individual jobs must opt in.
      Specified by:
      supportsDescriptor in class jenkins.scm.api.SCMFileSystem.Builder
      Parameters:
      descriptor - SCM descriptor to inspect
      Returns:
      whether the descriptor belongs to Git SCM
    • supportsDescriptor

      protected boolean supportsDescriptor(jenkins.scm.api.SCMSourceDescriptor descriptor)
      Reports that SCM source descriptors are unsupported.
      Specified by:
      supportsDescriptor in class jenkins.scm.api.SCMFileSystem.Builder
      Parameters:
      descriptor - SCM source descriptor to inspect
      Returns:
      false
    • build

      public jenkins.scm.api.SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, jenkins.scm.api.SCMRevision revision) throws IOException, InterruptedException
      Builds a REST filesystem without a build environment for variable expansion.
      Overrides:
      build in class jenkins.scm.api.SCMFileSystem.Builder
      Parameters:
      owner - item owning the SCM configuration and credential scope
      scm - SCM configuration
      revision - requested Git revision, or null to resolve the configured branch
      Returns:
      fixed REST filesystem, or null for an unsupported SCM or revision type
      Throws:
      IOException - if configuration, credential lookup or ref resolution fails
      InterruptedException - if filesystem initialization is interrupted
    • build

      public jenkins.scm.api.SCMFileSystem build(@NonNull Item owner, @NonNull SCM scm, jenkins.scm.api.SCMRevision revision, Run<?,?> run) throws IOException, InterruptedException
      Builds a fixed REST filesystem using job-scoped HTTP credentials. Requires one Git remote and one branch. A supplied Git revision takes precedence over the branch; otherwise, branch variables are expanded from the build environment when available.
      Overrides:
      build in class jenkins.scm.api.SCMFileSystem.Builder
      Parameters:
      owner - item owning the SCM configuration and credential scope
      scm - SCM configuration
      revision - requested Git revision, or null to resolve the configured branch
      run - optional build context for branch expansion and credential lookup
      Returns:
      fixed REST filesystem, or null for an unsupported SCM or revision type
      Throws:
      IOException - if configuration, credential lookup, environment loading or ref resolution fails
      InterruptedException - if obtaining the build environment is interrupted