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
,OnMaster
@Extension public class GitLabServers extends GlobalConfiguration implements PersistentDescriptor
Represents the global configuration of GitLab servers.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description GitLabServers()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description List<Descriptor>
actions()
Gets descriptor ofGitLabPersonalAccessTokenCreator
boolean
addServer(GitLabServer server)
Adds an server Checks if the GitLab Server name is uniqueGitLabServer
findServer(String serverName)
Checks to see if the supplied server URL is defined in the global configuration.static GitLabServers
get()
Gets theGitLabServers
singleton.String
getDisplayName()
ListBoxModel
getServerItems()
Populates aListBoxModel
with the servers.List<GitLabServer>
getServers()
Gets the list of endpoints.boolean
removeServer(String name)
Removes a server entry Checks if the GitLab Server name is matchedvoid
setServers(List<? extends GitLabServer> servers)
Sets the list of GitLab Serversboolean
updateServer(GitLabServer server)
Updates an existing endpoint (or adds if missing) Checks if the GitLab Server name is matched-
Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPage
-
Methods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface hudson.model.PersistentDescriptor
load
-
-
-
-
Field Detail
-
LOGGER
public static final Logger LOGGER
-
-
Method Detail
-
get
public static GitLabServers get()
Gets theGitLabServers
singleton.- Returns:
- the
GitLabServers
singleton.
-
getServerItems
public ListBoxModel getServerItems()
Populates aListBoxModel
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 classDescriptor<GlobalConfiguration>
-
actions
public List<Descriptor> actions()
Gets descriptor ofGitLabPersonalAccessTokenCreator
- 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.
-
-