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

    Fields
    Modifier and Type
    Field
    Description
    static final Logger
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    final Iterable<org.gitlab4j.api.models.Branch>
    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.
    final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
    Returns the ChangeRequestCheckoutStrategy to create for each fork merge request.
    org.gitlab4j.api.GitLabApi
    Returns the GitLabApi to use for the request.
    org.gitlab4j.api.models.Project
     
    final HashMap<String,org.gitlab4j.api.models.AccessLevel>
    Returns the Map of project Member or null 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 to isFetchMRs() or if the merge request details have not been provided by setMergeRequests(Iterable) yet.
    final Map<Boolean,Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>>
    Returns the ChangeRequestCheckoutStrategy to create for each merge request.
    final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
    getMRStrategies(boolean fork)
    Returns the ChangeRequestCheckoutStrategy to create for merge requests of the specified type.
    final Set<jenkins.scm.api.mixin.ChangeRequestCheckoutStrategy>
    Returns the ChangeRequestCheckoutStrategy to create for each origin merge request.
    org.gitlab4j.api.models.AccessLevel
    Returns the permissions of the supplied user.
    final Set<Long>
    Returns requested merge request numbers.
    final Set<String>
    Gets requested origin branch names.
    final Set<String>
    Gets requested tag names.
    final Iterable<org.gitlab4j.api.models.Tag>
    Returns the tag 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.
    final boolean
    Returns true if branch details need to be fetched.
    final boolean
    Returns true if fork merge request details need to be fetched.
    final boolean
    Returns true if merge request details need to be fetched.
    final boolean
    Returns true if origin merge request details need to be fetched.
    final boolean
    Returns true if tag details need to be fetched.
    boolean
    isMember(String username)
     
    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 the GitLabApi to use for the request.
    final void
    setMembers(HashMap<String,org.gitlab4j.api.models.AccessLevel> members)
    Provides the Map of project Member username and AccessLevel 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 the Project.
    final void
    setTags(Iterable<org.gitlab4j.api.models.Tag> 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

    Methods inherited from class java.lang.Object

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

    • LOGGER

      public static final Logger LOGGER
  • 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.
    • isFetchMRs

      public final boolean isFetchMRs()
      Returns true if merge request details need to be fetched.
      Returns:
      true if merge request details need to be fetched.
    • isFetchOriginMRs

      public final boolean isFetchOriginMRs()
      Returns true 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()
      Returns true 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 the ChangeRequestCheckoutStrategy 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 the ChangeRequestCheckoutStrategy 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 the ChangeRequestCheckoutStrategy 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 the ChangeRequestCheckoutStrategy 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 to isFetchMRs() or if the merge request details have not been provided by setMergeRequests(Iterable) yet.
      Returns:
      the details of merge requests, may be limited by getRequestedMergeRequestNumbers() or may be empty if not isFetchMRs()
    • 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 to isFetchBranches() or if the branch details have not been provided by setBranches(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 to isFetchTags() ()} or if the tag details have not been provided by setTags(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 project Member or null if those details have not been provided yet.
      Returns:
      the Map of project Member or null 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 project Member username and AccessLevel of the member.
      Parameters:
      members - the Map of project Member username and AccessLevel of the member.
    • getGitLabApi

      @CheckForNull public org.gitlab4j.api.GitLabApi getGitLabApi()
      Returns the GitLabApi to use for the request.
      Returns:
      the GitLabApi to use for the request or null if caller should establish their own.
    • setGitLabApi

      public void setGitLabApi(@CheckForNull org.gitlab4j.api.GitLabApi gitLabApi)
      Provides the GitLabApi 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 interface AutoCloseable
      Specified by:
      close in interface Closeable
      Overrides:
      close in class jenkins.scm.api.trait.SCMSourceRequest
      Throws:
      IOException
    • setProject

      public void setProject(org.gitlab4j.api.models.Project gitlabProject)
      Sets the Project.
      Parameters:
      gitlabProject - the Project.
    • getGitlabProject

      @CheckForNull public org.gitlab4j.api.models.Project getGitlabProject()