Class GitLabServers

java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
io.jenkins.plugins.gitlabserverconfig.servers.GitLabServers
All Implemented Interfaces:
ExtensionPoint, Describable<GlobalConfiguration>, PersistentDescriptor, Saveable, Loadable, OnMaster

@Extension public class GitLabServers extends GlobalConfiguration implements PersistentDescriptor
Represents the global configuration of GitLab servers.
  • Field Details

    • LOGGER

      public static final Logger LOGGER
  • Constructor Details

    • GitLabServers

      public GitLabServers()
  • Method Details

    • getRequiredGlobalConfigPagePermission

      @NonNull public Permission getRequiredGlobalConfigPagePermission()
      Overrides:
      getRequiredGlobalConfigPagePermission in class Descriptor<GlobalConfiguration>
    • get

      public static GitLabServers get()
      Gets the GitLabServers singleton.
      Returns:
      the GitLabServers singleton.
    • getServerItems

      public ListBoxModel getServerItems()
      Populates a ListBoxModel with the servers.
      Returns:
      A ListBoxModel with all the servers
    • getServers

      @NonNull public List<GitLabServer> getServers()
      Gets the list of endpoints.
      Returns:
      the list of endpoints
    • setServers

      public void setServers(@CheckForNull List<? extends GitLabServer> servers)
      Sets the list of GitLab Servers
      Parameters:
      servers - the list of endpoints.
    • getDisplayName

      @NonNull public String getDisplayName()
      Overrides:
      getDisplayName in class Descriptor<GlobalConfiguration>
    • actions

      public List<Descriptor> actions()
      Returns:
      the list of descriptors
    • addServer

      public boolean addServer(@NonNull GitLabServer server)
      Adds an server Checks if the GitLab Server name is unique
      Parameters:
      server - the server to add.
      Returns:
      true if the list of endpoints was modified
    • updateServer

      public boolean updateServer(@NonNull GitLabServer server)
      Updates an existing endpoint (or adds if missing) Checks if the GitLab Server name is matched
      Parameters:
      server - the server to update.
      Returns:
      true if the list of endpoints was modified
    • removeServer

      public boolean removeServer(@CheckForNull String name)
      Removes a server entry Checks if the GitLab Server name is matched
      Parameters:
      name - the server name to remove.
      Returns:
      true if the list of endpoints was modified
    • findServer

      @CheckForNull public GitLabServer findServer(@CheckForNull String serverName)
      Checks to see if the supplied server URL is defined in the global configuration.
      Parameters:
      serverName - the server url to check.
      Returns:
      the global configuration for the specified server url or null if not defined.
    • migrateWebhookSecretsToCredentials

      @Initializer(after=EXTENSIONS_AUGMENTED) public static void migrateWebhookSecretsToCredentials()