Class BitbucketSCMSourceRequest

java.lang.Object
jenkins.scm.api.trait.SCMSourceRequest
com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSourceRequest
All Implemented Interfaces:
Closeable, AutoCloseable

public class BitbucketSCMSourceRequest extends jenkins.scm.api.trait.SCMSourceRequest
The SCMSourceRequest for bitbucket.
Since:
2.2.0
  • Constructor Details

    • BitbucketSCMSourceRequest

      protected BitbucketSCMSourceRequest(@NonNull BitbucketSCMSource source, @NonNull BitbucketSCMSourceContext context, @CheckForNull TaskListener listener)
      Constructor.
      Parameters:
      source - the source.
      context - the context.
      listener - the listener.
  • Method Details

    • isFetchBranches

      public final boolean isFetchBranches()
      Returns true if branch details need to be fetched.
      Returns:
      true if branch details need to be fetched.
    • isFetchTags

      public final boolean isFetchTags()
      Returns true if tag details need to be fetched.
      Returns:
      true if tag details need to be fetched.
    • isFetchPRs

      public final boolean isFetchPRs()
      Returns true if pull request details need to be fetched.
      Returns:
      true if pull request details need to be fetched.
    • isFetchOriginPRs

      public final boolean isFetchOriginPRs()
      Returns true if origin pull request details need to be fetched.
      Returns:
      true if origin pull request details need to be fetched.
    • isFetchForkPRs

      public final boolean isFetchForkPRs()
      Returns true if fork pull request details need to be fetched.
      Returns:
      true if fork pull request details need to be fetched.
    • isSkipPublicPRs

      public final boolean isSkipPublicPRs()
      Returns true if pull requests from public repositories should be skipped.
      Returns:
      true if pull requests from public repositories should be skipped.
    • getOriginPRStrategies

      @NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getOriginPRStrategies()
      Returns the ChangeRequestCheckoutStrategy to create for each origin pull request.
      Returns:
      the ChangeRequestCheckoutStrategy to create for each origin pull request.
    • getForkPRStrategies

      @NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getForkPRStrategies()
      Returns the ChangeRequestCheckoutStrategy to create for each fork pull request.
      Returns:
      the ChangeRequestCheckoutStrategy to create for each fork pull request.
    • getPRStrategies

      @NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getPRStrategies(boolean fork)
      Returns the ChangeRequestCheckoutStrategy to create for pull requests of the specified type.
      Parameters:
      fork - true to return strategies for the fork pull requests, false for origin pull requests.
      Returns:
      the ChangeRequestCheckoutStrategy to create for each pull request.
    • getPRStrategies

      public final Map<Boolean,Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>> getPRStrategies()
      Returns the ChangeRequestCheckoutStrategy to create for each pull request.
      Returns:
      a map of the ChangeRequestCheckoutStrategy to create for each pull request keyed by whether the strategy applies to forks or not (Boolean.FALSE is the key for origin pull requests)
    • getRequestedPullRequestNumbers

      @CheckForNull public final Set<String> getRequestedPullRequestNumbers()
      Returns requested pull request numbers.
      Returns:
      the requested pull request numbers or null if the request was not scoped to a subset of pull requests.
    • getRequestedOriginBranchNames

      @CheckForNull public final Set<String> getRequestedOriginBranchNames()
      Gets requested origin branch names.
      Returns:
      the requested origin branch names or null if the request was not scoped to a subset of branches.
    • getRequestedTagNames

      @CheckForNull public final Set<String> getRequestedTagNames()
      Gets requested tag names.
      Returns:
      the requested tag names or null if the request was not scoped to a subset of tags.
    • getRepoOwner

      @NonNull public final String getRepoOwner()
      Returns:
      the BitbucketSCMSource.getRepoOwner()
    • getRepository

      @NonNull public final String getRepository()
      Returns:
      the BitbucketSCMSource.getRepository().
    • setPullRequests

      public final void setPullRequests(@CheckForNull Iterable<BitbucketPullRequest> pullRequests)
      Provides the requests with the pull request details.
      Parameters:
      pullRequests - the pull request details.
    • getPullRequests

      @NonNull public final Iterable<BitbucketPullRequest> getPullRequests()
      Returns the pull request details or an empty list if either the request did not specify to isFetchPRs() or if the pull request details have not been provided by setPullRequests(Iterable) yet.
      Returns:
      the pull request details (may be empty)
    • getPullRequestById

      public final BitbucketPullRequest getPullRequestById(Integer id) throws IOException, InterruptedException
      Retrieves the full details of a pull request.
      Parameters:
      id - The id of the pull request to retrieve the details about.
      Returns:
      The BitbucketPullRequest object.
      Throws:
      IOException - If the request to retrieve the full details encounters an issue.
      InterruptedException - If the request to retrieve the full details is interrupted.
    • setBranches

      public final void setBranches(@CheckForNull Iterable<BitbucketBranch> branches)
      Provides the requests with the branch details.
      Parameters:
      branches - the branch details.
    • getBranches

      @NonNull public final Iterable<BitbucketBranch> getBranches()
      Returns the branch details or an empty list if either the request did not specify to isFetchBranches() or if the branch details have not been provided by setBranches(Iterable) yet.
      Returns:
      the branch details (may be empty)
    • setTags

      public final void setTags(@CheckForNull Iterable<BitbucketBranch> tags)
      Provides the requests with the tag details.
      Parameters:
      tags - the tag details.
    • getTags

      @NonNull public final Iterable<BitbucketBranch> getTags()
      Returns the branch details or an empty list if either the request did not specify to isFetchTags() or if the tag details have not been provided by setTags(Iterable) yet.
      Returns:
      the tag details (may be empty)
    • close

      public void close() throws IOException
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class jenkins.scm.api.trait.SCMSourceRequest
      Throws:
      IOException