Class GitLabSCMSourceRequest
java.lang.Object
jenkins.scm.api.trait.SCMSourceRequest
io.jenkins.plugins.gitlabbranchsource.GitLabSCMSourceRequest
- All Implemented Interfaces:
Closeable
,AutoCloseable
public class GitLabSCMSourceRequest
extends jenkins.scm.api.trait.SCMSourceRequest
-
Nested Class Summary
Nested 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> -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
final Iterable<org.gitlab4j.api.models.Branch>
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 theChangeRequestCheckoutStrategy
to create for each fork merge request.org.gitlab4j.api.GitLabApi
Returns theGitLabApi
to use for the request.org.gitlab4j.api.models.Project
Returns the Map of projectMember
ornull
if those details have not been provided yet.Iterable<org.gitlab4j.api.models.MergeRequest>
Returns the merge request details or an empty list if either the request did not specify toisFetchMRs()
or if the merge request details have not been provided bysetMergeRequests(Iterable)
yet.Returns theChangeRequestCheckoutStrategy
to create for each merge request.final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
getMRStrategies
(boolean fork) Returns theChangeRequestCheckoutStrategy
to create for merge requests of the specified type.final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
Returns theChangeRequestCheckoutStrategy
to create for each origin merge request.org.gitlab4j.api.models.AccessLevel
getPermission
(String username) Returns the permissions of the supplied user.Returns requested merge request numbers.Gets requested origin branch names.Gets requested tag names.final Iterable<org.gitlab4j.api.models.Tag>
getTags()
Returns the tag 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 boolean
Returnstrue
if branch details need to be fetched.final boolean
Returnstrue
if fork merge request details need to be fetched.final boolean
Returnstrue
if merge request details need to be fetched.final boolean
Returnstrue
if origin merge request details need to be fetched.final boolean
Returnstrue
if tag details need to be fetched.boolean
final void
setBranches
(Iterable<org.gitlab4j.api.models.Branch> branches) Provides the requests with the branch details.void
setGitLabApi
(org.gitlab4j.api.GitLabApi gitLabApi) Provides theGitLabApi
to use for the request.final void
setMembers
(HashMap<String, org.gitlab4j.api.models.AccessLevel> members) Provides the Map of projectMember
username andAccessLevel
of the member.void
setMergeRequests
(Iterable<org.gitlab4j.api.models.MergeRequest> mergeRequests) Provides the requests with the merge request details.void
setProject
(org.gitlab4j.api.models.Project gitlabProject) Sets theProject
.final void
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
-
Field Details
-
LOGGER
-
-
Method Details
-
isFetchBranches
public final boolean isFetchBranches()Returnstrue
if branch details need to be fetched.- Returns:
true
if branch details need to be fetched.
-
isFetchTags
public final boolean isFetchTags()Returnstrue
if tag details need to be fetched.- Returns:
true
if tag details need to be fetched.
-
isFetchMRs
public final boolean isFetchMRs()Returnstrue
if merge request details need to be fetched.- Returns:
true
if merge request details need to be fetched.
-
isFetchOriginMRs
public final boolean isFetchOriginMRs()Returnstrue
if origin merge request details need to be fetched.- Returns:
true
if origin merge request details need to be fetched.
-
isFetchForkMRs
public final boolean isFetchForkMRs()Returnstrue
if fork merge request details need to be fetched.- Returns:
true
if fork merge request details need to be fetched.
-
getOriginMRStrategies
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getOriginMRStrategies()Returns theChangeRequestCheckoutStrategy
to create for each origin merge request.- Returns:
- the
ChangeRequestCheckoutStrategy
to create for each origin merge request.
-
getForkMRStrategies
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getForkMRStrategies()Returns theChangeRequestCheckoutStrategy
to create for each fork merge request.- Returns:
- the
ChangeRequestCheckoutStrategy
to create for each fork merge request.
-
getMRStrategies
@NonNull public final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy> getMRStrategies(boolean fork) Returns theChangeRequestCheckoutStrategy
to create for merge requests of the specified type.- Parameters:
fork
-true
to return strategies for the fork merge requests,false
for origin merge requests.- Returns:
- the
ChangeRequestCheckoutStrategy
to create for each merge request.
-
getMRStrategies
public final Map<Boolean,Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>> getMRStrategies()Returns theChangeRequestCheckoutStrategy
to create for each merge request.- Returns:
- a map of the
ChangeRequestCheckoutStrategy
to create for each merge request keyed by whether the strategy applies to forks or not (Boolean.FALSE
is the key for origin merge requests)
-
getRequestedMergeRequestNumbers
Returns requested merge request numbers.- Returns:
- the requested merge request numbers or
null
if the request was not scoped to a subset of merge requests.
-
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
Gets requested tag names.- Returns:
- the requested tag names or
null
if the request was not scoped to a subset of tags.
-
getMergeRequests
Returns the merge request details or an empty list if either the request did not specify toisFetchMRs()
or if the merge request details have not been provided bysetMergeRequests(Iterable)
yet.- Returns:
- the details of merge requests, may be limited by
getRequestedMergeRequestNumbers()
or may be empty if notisFetchMRs()
-
setMergeRequests
public void setMergeRequests(@CheckForNull Iterable<org.gitlab4j.api.models.MergeRequest> mergeRequests) Provides the requests with the merge request details.- Parameters:
mergeRequests
- the merge request details.
-
getBranches
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.- Returns:
- the branch details (may be empty)
-
setBranches
Provides the requests with the branch details.- Parameters:
branches
- the branch details.
-
getTags
Returns the tag 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)
-
setTags
Provides the requests with the tag details.- Parameters:
tags
- the tag details.
-
getMembers
Returns the Map of projectMember
ornull
if those details have not been provided yet.- Returns:
- the Map of project
Member
ornull
if those details have not been provided yet.
-
setMembers
public final void setMembers(@CheckForNull HashMap<String, org.gitlab4j.api.models.AccessLevel> members) Provides the Map of projectMember
username andAccessLevel
of the member.- Parameters:
members
- the Map of projectMember
username andAccessLevel
of the member.
-
getGitLabApi
@CheckForNull public org.gitlab4j.api.GitLabApi getGitLabApi()Returns theGitLabApi
to use for the request.- Returns:
- the
GitLabApi
to use for the request ornull
if caller should establish their own.
-
setGitLabApi
public void setGitLabApi(@CheckForNull org.gitlab4j.api.GitLabApi gitLabApi) Provides theGitLabApi
to use for the request.- Parameters:
gitLabApi
-GitLabApi
to use for the request.
-
getPermission
Returns the permissions of the supplied user.- Parameters:
username
- the username of MR author- Returns:
AccessLevel
the permissions of the supplied user.
-
isMember
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Overrides:
close
in classjenkins.scm.api.trait.SCMSourceRequest
- Throws:
IOException
-
setProject
public void setProject(org.gitlab4j.api.models.Project gitlabProject) Sets theProject
.- Parameters:
gitlabProject
- theProject
.
-
getGitlabProject
@CheckForNull public org.gitlab4j.api.models.Project getGitlabProject()
-