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>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
Iterable<org.gitlab4j.api.models.Branch>
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.Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
getForkMRStrategies()
Returns theChangeRequestCheckoutStrategy
to create for each fork merge request.org.gitlab4j.api.GitLabApi
getGitLabApi()
Returns theGitLabApi
to use for the request.org.gitlab4j.api.models.Project
getGitlabProject()
HashMap<String,org.gitlab4j.api.models.AccessLevel>
getMembers()
Returns the Map of projectMember
ornull
if those details have not been provided yet.Iterable<org.gitlab4j.api.models.MergeRequest>
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.Map<Boolean,Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>>
getMRStrategies()
Returns theChangeRequestCheckoutStrategy
to create for each merge request.Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
getMRStrategies(boolean fork)
Returns theChangeRequestCheckoutStrategy
to create for merge requests of the specified type.Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
getOriginMRStrategies()
Returns theChangeRequestCheckoutStrategy
to create for each origin merge request.org.gitlab4j.api.models.AccessLevel
getPermission(String username)
Returns the permissions of the supplied user.Set<Long>
getRequestedMergeRequestNumbers()
Returns requested merge request numbers.Set<String>
getRequestedOriginBranchNames()
Gets requested origin branch names.Set<String>
getRequestedTagNames()
Gets requested tag names.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.boolean
isFetchBranches()
Returnstrue
if branch details need to be fetched.boolean
isFetchForkMRs()
Returnstrue
if fork merge request details need to be fetched.boolean
isFetchMRs()
Returnstrue
if merge request details need to be fetched.boolean
isFetchOriginMRs()
Returnstrue
if origin merge request details need to be fetched.boolean
isFetchTags()
Returnstrue
if tag details need to be fetched.boolean
isMember(String username)
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.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
.void
setTags(Iterable<org.gitlab4j.api.models.Tag> tags)
Provides the requests with the tag details.
-
-
-
Field Detail
-
LOGGER
public static final Logger LOGGER
-
-
Method Detail
-
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
@CheckForNull public final Set<Long> 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
@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.
-
getMergeRequests
@NonNull public Iterable<org.gitlab4j.api.models.MergeRequest> 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
@NonNull public final Iterable<org.gitlab4j.api.models.Branch> 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
public final void setBranches(@CheckForNull Iterable<org.gitlab4j.api.models.Branch> branches)
Provides the requests with the branch details.- Parameters:
branches
- the branch details.
-
getTags
@NonNull public 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.- Returns:
- the tag details (may be empty)
-
setTags
public final void setTags(@CheckForNull Iterable<org.gitlab4j.api.models.Tag> tags)
Provides the requests with the tag details.- Parameters:
tags
- the tag details.
-
getMembers
public final HashMap<String,org.gitlab4j.api.models.AccessLevel> 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
public org.gitlab4j.api.models.AccessLevel getPermission(String username)
Returns the permissions of the supplied user.- Parameters:
username
- the username of MR author- Returns:
AccessLevel
the permissions of the supplied user.
-
isMember
public boolean isMember(String username)
-
close
public void close() throws IOException
- 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()
-
-