Class GitLabSCMSource

java.lang.Object
hudson.model.AbstractDescribableImpl<jenkins.scm.api.SCMSource>
jenkins.scm.api.SCMSource
jenkins.plugins.git.AbstractGitSCMSource
io.jenkins.plugins.gitlabbranchsource.GitLabSCMSource
All Implemented Interfaces:
ExtensionPoint, Describable<jenkins.scm.api.SCMSource>

public class GitLabSCMSource extends jenkins.plugins.git.AbstractGitSCMSource
  • Field Details

    • LOGGER

      public static final Logger LOGGER
  • Constructor Details

    • GitLabSCMSource

      @DataBoundConstructor public GitLabSCMSource(String serverName, String projectOwner, String projectPath)
  • Method Details

    • getServerName

      public String getServerName()
    • getProjectOwner

      public String getProjectOwner()
    • getProjectPath

      public String getProjectPath()
    • getHttpRemote

      public String getHttpRemote()
    • setHttpRemote

      public void setHttpRemote(String httpRemote)
    • getSshRemote

      public String getSshRemote()
    • setSshRemote

      public void setSshRemote(String sshRemote)
    • getLastRetrieveTimestamp

      public Long getLastRetrieveTimestamp()
    • setLastRetrieveTimestamp

      public void setLastRetrieveTimestamp(Long lastRetrieveTimestamp)
    • getProjectName

      public String getProjectName()
    • setProjectName

      public void setProjectName(String projectName)
      Only used for saving project name for GitLabSCMNavigator
      Parameters:
      projectName - the name of the project
    • getCredentialsId

      public String getCredentialsId()
      Specified by:
      getCredentialsId in class jenkins.plugins.git.AbstractGitSCMSource
    • setCredentialsId

      @DataBoundSetter public void setCredentialsId(String credentialsId)
    • getRemote

      public String getRemote()
      Specified by:
      getRemote in class jenkins.plugins.git.AbstractGitSCMSource
    • getGitlabProject

      protected org.gitlab4j.api.models.Project getGitlabProject() throws org.gitlab4j.api.GitLabApiException
      See getGitlabProject(GitLabApi).
      This method uses this object's pre-configured SCMSource.getOwner() and serverName to build the GitLab API endpoint that will be used.
      Throws:
      org.gitlab4j.api.GitLabApiException
      See Also:
    • getGitlabProject

      protected org.gitlab4j.api.models.Project getGitlabProject(org.gitlab4j.api.GitLabApi gitLabApi) throws org.gitlab4j.api.GitLabApiException
      Returns the configuration of the corresponding GitLab project. As a side-effect, fills in the sshRemote, httpRemote and projectId fields.
      Note that if any error occurs when communicating with the GitLab API, the fields mentioned above may be left empty. Only if this method returns successfully can they be guaranteed to be filled in.
      Parameters:
      gitLabApi - The reference to the GitLab API server.
      Returns:
      The GitLab Project representing this object, as pointed at by the projectPath.
      Throws:
      org.gitlab4j.api.GitLabApiException - When any exception occurs while communicating with a GitLab API endpoint.
    • getMembers

      public HashMap<String,org.gitlab4j.api.models.AccessLevel> getMembers()
    • getProjectId

      public Long getProjectId()
    • setProjectId

      @DataBoundSetter public void setProjectId(Long projectId)
    • getTraits

      @NonNull public List<jenkins.scm.api.trait.SCMSourceTrait> getTraits()
      Overrides:
      getTraits in class jenkins.plugins.git.AbstractGitSCMSource
    • setTraits

      @DataBoundSetter public void setTraits(List<jenkins.scm.api.trait.SCMSourceTrait> traits)
      Overrides:
      setTraits in class jenkins.scm.api.SCMSource
    • retrieve

      protected jenkins.scm.api.SCMRevision retrieve(@NonNull jenkins.scm.api.SCMHead head, @NonNull TaskListener listener) throws IOException
      Overrides:
      retrieve in class jenkins.plugins.git.AbstractGitSCMSource
      Throws:
      IOException
    • retrieve

      protected void retrieve(jenkins.scm.api.SCMSourceCriteria criteria, @NonNull jenkins.scm.api.SCMHeadObserver observer, jenkins.scm.api.SCMHeadEvent<?> event, @NonNull TaskListener listener) throws IOException, InterruptedException
      Overrides:
      retrieve in class jenkins.plugins.git.AbstractGitSCMSource
      Throws:
      IOException
      InterruptedException
    • retrieve

      protected jenkins.scm.api.SCMRevision retrieve(@NonNull String thingName, @NonNull TaskListener listener) throws IOException, InterruptedException
      Overrides:
      retrieve in class jenkins.scm.api.SCMSource
      Throws:
      IOException
      InterruptedException
    • retrieveRevisions

      @NonNull protected Set<String> retrieveRevisions(@NonNull TaskListener listener) throws IOException, InterruptedException
      Overrides:
      retrieveRevisions in class jenkins.scm.api.SCMSource
      Throws:
      IOException
      InterruptedException
    • retrieveActions

      @NonNull protected List<Action> retrieveActions(jenkins.scm.api.SCMSourceEvent event, @NonNull TaskListener listener) throws IOException
      Overrides:
      retrieveActions in class jenkins.plugins.git.AbstractGitSCMSource
      Throws:
      IOException
    • retrieveActions

      @NonNull protected List<Action> retrieveActions(@NonNull jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMHeadEvent event, @NonNull TaskListener listener) throws IOException
      Overrides:
      retrieveActions in class jenkins.plugins.git.AbstractGitSCMSource
      Throws:
      IOException
    • build

      @NonNull public SCM build(@NonNull jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision)
      Overrides:
      build in class jenkins.plugins.git.AbstractGitSCMSource
    • getTrustedRevision

      @NonNull public jenkins.scm.api.SCMRevision getTrustedRevision(@NonNull jenkins.scm.api.SCMRevision revision, @NonNull TaskListener listener)
      Overrides:
      getTrustedRevision in class jenkins.scm.api.SCMSource
    • retrieveActions

      @NonNull protected List<Action> retrieveActions(@NonNull jenkins.scm.api.SCMRevision revision, jenkins.scm.api.SCMHeadEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException
      Overrides:
      retrieveActions in class jenkins.scm.api.SCMSource
      Throws:
      IOException
      InterruptedException
    • createProbe

      @NonNull protected jenkins.scm.api.SCMProbe createProbe(@NonNull jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision) throws IOException
      Overrides:
      createProbe in class jenkins.scm.api.SCMSource
      Throws:
      IOException
    • afterSave

      public void afterSave()
      Overrides:
      afterSave in class jenkins.scm.api.SCMSource
    • credentials

      public com.cloudbees.plugins.credentials.common.StandardCredentials credentials()