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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classNested classes/interfaces inherited from class jenkins.scm.api.trait.SCMSourceRequest
jenkins.scm.api.trait.SCMSourceRequest.IntermediateLambda<I extends Object>, jenkins.scm.api.trait.SCMSourceRequest.LazyRevisionLambda<H extends jenkins.scm.api.SCMHead,R extends jenkins.scm.api.SCMRevision, I extends Object>, jenkins.scm.api.trait.SCMSourceRequest.ProbeLambda<H extends jenkins.scm.api.SCMHead, I extends Object>, jenkins.scm.api.trait.SCMSourceRequest.RevisionLambda<H extends jenkins.scm.api.SCMHead, R extends jenkins.scm.api.SCMRevision>, jenkins.scm.api.trait.SCMSourceRequest.Witness<H extends jenkins.scm.api.SCMHead, R extends jenkins.scm.api.SCMRevision> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedBitbucketSCMSourceRequest(BitbucketSCMSource source, BitbucketSCMSourceContext context, TaskListener listener) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()final Iterable<BitbucketBranch>Returns the branch details or an empty list if either the request did not specify toisFetchBranches()or if the branch details have not been provided bysetBranches(Iterable)yet.final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>Returns theChangeRequestCheckoutStrategyto create for each fork pull request.final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>Returns theChangeRequestCheckoutStrategyto create for each origin pull request.Returns theChangeRequestCheckoutStrategyto create for each pull request.final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>getPRStrategies(boolean fork) Returns theChangeRequestCheckoutStrategyto create for pull requests of the specified type.final BitbucketPullRequestRetrieves the full details of a pull request.final Iterable<BitbucketPullRequest>Returns the pull request details or an empty list if either the request did not specify toisFetchPRs()or if the pull request details have not been provided bysetPullRequests(Iterable)yet.final StringReturns theBitbucketSCMSource.getRepoOwner()final StringReturns theBitbucketSCMSource.getRepository().Gets requested origin branch names.Returns requested pull request numbers.Gets requested tag names.final Iterable<BitbucketBranch>getTags()Returns the branch details or an empty list if either the request did not specify toisFetchTags()or if the tag details have not been provided bysetTags(Iterable)yet.final booleanReturnstrueif branch details need to be fetched.final booleanReturnstrueif fork pull request details need to be fetched.final booleanReturnstrueif origin pull request details need to be fetched.final booleanReturnstrueif pull request details need to be fetched.final booleanReturnstrueif tag details need to be fetched.final booleanReturnstrueif pull requests from public repositories should be skipped.final <H extends jenkins.scm.api.SCMHead,I, R extends jenkins.scm.api.SCMRevision>
booleanprocess(H head, jenkins.scm.api.trait.SCMSourceRequest.IntermediateLambda<I> intermediateFactory) Processes a head in the context of the current request where an intermediary operation is required before theSCMRevisioncan be instantiated.final voidsetBranches(Iterable<BitbucketBranch> branches) Provides the requests with the branch details.final voidsetPullRequests(Iterable<BitbucketPullRequest> pullRequests) Provides the requests with the pull request details.final voidsetTags(Iterable<BitbucketBranch> tags) Provides the requests with the tag details.Methods inherited from class jenkins.scm.api.trait.SCMSourceRequest
getCriteria, isComplete, isExcluded, isTrusted, listener, manage, process, process, process
-
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()Returnstrueif branch details need to be fetched.- Returns:
trueif branch details need to be fetched.
-
isFetchTags
public final boolean isFetchTags()Returnstrueif tag details need to be fetched.- Returns:
trueif tag details need to be fetched.
-
isFetchPRs
public final boolean isFetchPRs()Returnstrueif pull request details need to be fetched.- Returns:
trueif pull request details need to be fetched.
-
isFetchOriginPRs
public final boolean isFetchOriginPRs()Returnstrueif origin pull request details need to be fetched.- Returns:
trueif origin pull request details need to be fetched.
-
isFetchForkPRs
public final boolean isFetchForkPRs()Returnstrueif fork pull request details need to be fetched.- Returns:
trueif fork pull request details need to be fetched.
-
isSkipPublicPRs
public final boolean isSkipPublicPRs()Returnstrueif pull requests from public repositories should be skipped.- Returns:
trueif pull requests from public repositories should be skipped.
-
getOriginPRStrategies
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getOriginPRStrategies()Returns theChangeRequestCheckoutStrategyto create for each origin pull request.- Returns:
- the
ChangeRequestCheckoutStrategyto create for each origin pull request.
-
getForkPRStrategies
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getForkPRStrategies()Returns theChangeRequestCheckoutStrategyto create for each fork pull request.- Returns:
- the
ChangeRequestCheckoutStrategyto create for each fork pull request.
-
getPRStrategies
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getPRStrategies(boolean fork) Returns theChangeRequestCheckoutStrategyto create for pull requests of the specified type.- Parameters:
fork-trueto return strategies for the fork pull requests,falsefor origin pull requests.- Returns:
- the
ChangeRequestCheckoutStrategyto create for each pull request.
-
getPRStrategies
public final Map<Boolean,Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>> getPRStrategies()Returns theChangeRequestCheckoutStrategyto create for each pull request.- Returns:
- a map of the
ChangeRequestCheckoutStrategyto create for each pull request keyed by whether the strategy applies to forks or not (Boolean.FALSEis the key for origin pull requests)
-
getRequestedPullRequestNumbers
Returns requested pull request numbers.- Returns:
- the requested pull request numbers or
nullif the request was not scoped to a subset of pull requests.
-
getRequestedOriginBranchNames
Gets requested origin branch names.- Returns:
- the requested origin branch names or
nullif the request was not scoped to a subset of branches.
-
getRequestedTagNames
Gets requested tag names.- Returns:
- the requested tag names or
nullif the request was not scoped to a subset of tags.
-
getRepoOwner
Returns theBitbucketSCMSource.getRepoOwner()- Returns:
- the
BitbucketSCMSource.getRepoOwner()
-
getRepository
Returns theBitbucketSCMSource.getRepository().- Returns:
- the
BitbucketSCMSource.getRepository().
-
setPullRequests
Provides the requests with the pull request details.- Parameters:
pullRequests- the pull request details.
-
getPullRequests
@NonNull public final Iterable<BitbucketPullRequest> getPullRequests() throws IOException, InterruptedExceptionReturns the pull request details or an empty list if either the request did not specify toisFetchPRs()or if the pull request details have not been provided bysetPullRequests(Iterable)yet.- Returns:
- the pull request details (may be empty)
- Throws:
IOException- If the request to retrieve the full details encounters an issue.InterruptedException- If the request to retrieve the full details is interrupted.
-
getPullRequestById
Retrieves the full details of a pull request.- Parameters:
id- The id of the pull request to retrieve the details about.- Returns:
- The
BitbucketPullRequestobject. - Throws:
IOException- If the request to retrieve the full details encounters an issue.
-
setBranches
Provides the requests with the branch details.- Parameters:
branches- the branch details.
-
getBranches
@NonNull public final Iterable<BitbucketBranch> getBranches() throws IOException, InterruptedExceptionReturns the branch details or an empty list if either the request did not specify toisFetchBranches()or if the branch details have not been provided bysetBranches(Iterable)yet.- Returns:
- the branch details (may be empty)
- Throws:
IOException- if there was a network communications error.InterruptedException- if interrupted while waiting on remote communications.
-
setTags
Provides the requests with the tag details.- Parameters:
tags- the tag details.
-
getTags
Returns the branch details or an empty list if either the request did not specify toisFetchTags()or if the tag details have not been provided bysetTags(Iterable)yet.- Returns:
- the tag details (may be empty)
- Throws:
IOException- if there was a network communications error.InterruptedException- if interrupted while waiting on remote communications.
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Overrides:
closein classjenkins.scm.api.trait.SCMSourceRequest- Throws:
IOException
-
process
public final <H extends jenkins.scm.api.SCMHead,I, boolean processR extends jenkins.scm.api.SCMRevision> (@NonNull H head, @CheckForNull jenkins.scm.api.trait.SCMSourceRequest.IntermediateLambda<I> intermediateFactory) throws IOException, InterruptedException Processes a head in the context of the current request where an intermediary operation is required before theSCMRevisioncan be instantiated.- Type Parameters:
H- the type ofSCMHead.I- the type of the intermediary operation result.R- the type ofSCMRevision.- Parameters:
head- theSCMHeadto process.intermediateFactory- factory method that provides the seed information for both theSCMSourceRequest.ProbeLambdaand theSCMSourceRequest.LazyRevisionLambda.- Returns:
trueif theSCMHeadObserverfor this request has completed observing,falseto continue processing.- Throws:
IOException- if there was an I/O error.InterruptedException- if the processing was interrupted.
-