Class GitLabServer

java.lang.Object
hudson.model.AbstractDescribableImpl<GitLabServer>
io.jenkins.plugins.gitlabserverconfig.servers.GitLabServer
All Implemented Interfaces:
Describable<GitLabServer>

public class GitLabServer extends AbstractDescribableImpl<GitLabServer>
Represents a GitLab Server instance.
  • Field Details

    • CREDENTIALS_MATCHER

      public static final com.cloudbees.plugins.credentials.CredentialsMatcher CREDENTIALS_MATCHER
      The credentials matcher for PersonalAccessToken and StringCredentials
    • GITLAB_SERVER_DEFAULT_NAME

      public static final String GITLAB_SERVER_DEFAULT_NAME
      Default name for community SaaS version server
      See Also:
    • GITLAB_SERVER_URL

      public static final String GITLAB_SERVER_URL
      Used as default community SaaS version server URL for the serverUrl field
      See Also:
    • EMPTY_TOKEN

      public static final String EMPTY_TOKEN
      Used as default token value if no any credentials found by given credentialsId.
      See Also:
    • LOGGER

      public static final Logger LOGGER
    • WEBHOOK_SECRET_CREDENTIALS_MATCHER

      public static final com.cloudbees.plugins.credentials.CredentialsMatcher WEBHOOK_SECRET_CREDENTIALS_MATCHER
      The credentials matcher for StringCredentials
  • Constructor Details

    • GitLabServer

      @DataBoundConstructor public GitLabServer(@NonNull String serverUrl, @NonNull String name, @NonNull String credentialsId)
      Data Bound Constructor for only mandatory parameter serverUrl
      Parameters:
      serverUrl - The URL of this GitLab Server
      name - A unique name to use to describe the end-point, if empty replaced with a random name
      credentialsId - The IdCredentials.getId() of the credentials to use for GitLab Server Authentication to access GitLab APIs
  • Method Details

    • getName

      @NonNull public String getName()
    • getServerUrl

      @NonNull public String getServerUrl()
    • isManageWebHooks

      public boolean isManageWebHooks()
      Returns true if Jenkins is supposed to auto-manage web hooks for this end-point.
      Returns:
      true if Jenkins is supposed to auto-manage web hooks for this end-point.
    • setManageWebHooks

      @DataBoundSetter public void setManageWebHooks(boolean manageWebHooks)
      Data Bound Setter for auto management of web hooks
      Parameters:
      manageWebHooks - true if and only if Jenkins is supposed to auto-manage web hooks for this end-point.
    • isManageSystemHooks

      public boolean isManageSystemHooks()
      Returns true if Jenkins is supposed to auto-manage system hooks for this end-point.
      Returns:
      true if Jenkins is supposed to auto-manage system hooks for this end-point.
    • setManageSystemHooks

      @DataBoundSetter public void setManageSystemHooks(boolean manageSystemHooks)
      Data Bound Setter for auto management of system hooks
      Parameters:
      manageSystemHooks - true if and only if Jenkins is supposed to auto-manage system hooks for this end-point.
    • getCredentialsId

      @NonNull public String getCredentialsId()
      Returns The IdCredentials.getId() of the credentials to use for GitLab Server Authentication to access GitLab APIs.
      Returns:
      The IdCredentials.getId() of the credentials to use for GitLab Server Authentication to access GitLab APIs.
    • getCredentials

      public com.cloudbees.plugins.credentials.common.StandardCredentials getCredentials(AccessControlled context)
      Looks up for PersonalAccessToken and StringCredentials
      Returns:
      StandardCredentials
    • setHooksRootUrl

      @DataBoundSetter public void setHooksRootUrl(String hooksRootUrl)
      Parameters:
      hooksRootUrl - a custom root URL, to be used in hooks instead of Jenkins.getRootUrl(). Set to null for default behavior.
    • getHooksRootUrl

      @CheckForNull public String getHooksRootUrl()
      Returns:
      the custom root URL, to be used in hooks instead of Jenkins.getRootUrl(). Can be either a root URL with its trailing slash, or null.
    • setSecretToken

      @DataBoundSetter @Deprecated public void setSecretToken(Secret token)
      Deprecated.
    • setWebhookSecretCredentialsId

      @DataBoundSetter public void setWebhookSecretCredentialsId(String token)
    • getWebhookSecretCredentialsId

      public String getWebhookSecretCredentialsId()
    • getWebhookSecretCredentials

      public org.jenkinsci.plugins.plaincredentials.StringCredentials getWebhookSecretCredentials(AccessControlled context)
      Looks up for StringCredentials
      Returns:
      StringCredentials
    • getDescriptor

      public GitLabServer.DescriptorImpl getDescriptor()
      Specified by:
      getDescriptor in interface Describable<GitLabServer>
      Overrides:
      getDescriptor in class AbstractDescribableImpl<GitLabServer>
    • getSecretToken

      @Deprecated public Secret getSecretToken()
      Deprecated.
    • getSecretTokenAsPlainText

      public String getSecretTokenAsPlainText()
    • isImmediateHookTrigger

      public boolean isImmediateHookTrigger()
      Returns true if Jenkins should trigger a build immediately on a GitLab Web Hook trigger.
      Returns:
      true if Jenkins should trigger a build immediately on a GitLab Web Hook trigger.
    • setImmediateHookTrigger

      @DataBoundSetter public void setImmediateHookTrigger(boolean immediateHookTrigger)
      Data Bound Setter for immediate build on a GitLab Web Hook trigger.
      Parameters:
      immediateHookTrigger - true if and only if Jenkins should trigger a build immediately on a GitLab Web Hook trigger.
    • setHookTriggerDelay

      @DataBoundSetter public void setHookTriggerDelay(String hookTriggerDelay)
      Data Bound Setter for web hook trigger delay
      Parameters:
      hookTriggerDelay - Delay to be used for GitLab Web Hook build triggers. Set to null to use delay equal to GitLab cache timeout, which will avoid builds being not triggered due to GitLab caching.
    • getHookTriggerDelay

      @CheckForNull public Integer getHookTriggerDelay()
      Returns:
      Delay to be used for GitLab Web Hook build triggers. Can be either a root URL with its trailing slash, or null. Can be null to request delay to be equal to GitLab cache timeout.