Class GiteaServers
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
org.jenkinsci.plugin.gitea.servers.GiteaServers
- All Implemented Interfaces:
ExtensionPoint,Describable<GlobalConfiguration>,Saveable,Loadable,OnMaster
Represents the global configuration of Gitea servers.
-
Nested Class Summary
Nested classes/interfaces inherited from class hudson.model.Descriptor
Descriptor.FormException, Descriptor.PropertyType, Descriptor.SelfNested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson -
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddServer(GiteaServer endpoint) Adds an endpoint.booleanconfigure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) findServer(String serverUrl) Checks to see if the supplied server URL is defined in the global configuration.static GiteaServersget()Gets theGiteaServerssingleton.Populates aListBoxModelwith the endpoints.Gets the list of endpoints.booleanReturnstrueif and only if there is more than one configured endpoint.static booleanisEventFor(String serverUrl, String eventUrl) Checks if the supplied event url is for the specified server url (after consultingstatic StringnormalizeServerUrl(String serverUrl) Fix a serverUrl.booleanremoveServer(String serverUrl) Removes an endpoint.booleanremoveServer(GiteaServer endpoint) Removes an endpoint.voidsetServers(List<? extends GiteaServer> servers) Sets the list of endpoints.voidupdateServer(GiteaServer endpoint) Updates an existing endpoint (or adds if missing).Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPageMethods inherited from class hudson.model.Descriptor
addHelpFileRedirect, bindJSON, bindJSON, calcAutoCompleteSettings, calcFillSettings, configure, doHelp, doHelp, find, find, findByDescribableClassName, findById, getCategory, getCheckMethod, getCheckUrl, getConfigFile, getConfigPage, getCurrentDescriptorByNameUrl, getDescriptorFullUrl, getDescriptorUrl, getDisplayName, getGlobalPropertyType, getHelpFile, getHelpFile, getHelpFile, getId, getJsonSafeClassName, getKlass, getPlugin, getPossibleViewNames, getPropertyType, getPropertyType, getPropertyTypeOrDie, getRequiredGlobalConfigPagePermission, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
GiteaServers
public GiteaServers()Constructor.
-
-
Method Details
-
get
Gets theGiteaServerssingleton.- Returns:
- the
GiteaServerssingleton.
-
normalizeServerUrl
Fix a serverUrl.- Parameters:
serverUrl- the server URL.- Returns:
- the normalized server URL.
-
isEventFor
Checks if the supplied event url is for the specified server url (after consulting- Parameters:
serverUrl- theGiteaServer.getServerUrl()eventUrl- the event url.- Returns:
trueif the event is a matchingGiteaServer.getAliasUrl()for registeredGiteaServerinstances)- Since:
- 1.0.5
-
isEndpointSelectable
public boolean isEndpointSelectable()Returnstrueif and only if there is more than one configured endpoint.- Returns:
trueif and only if there is more than one configured endpoint.
-
getServerItems
Populates aListBoxModelwith the endpoints.- Returns:
- A
ListBoxModelwith all the endpoints
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException - Overrides:
configurein classGlobalConfiguration- Throws:
Descriptor.FormException
-
getServers
Gets the list of endpoints.- Returns:
- the list of endpoints
-
setServers
Sets the list of endpoints.- Parameters:
servers- the list of endpoints.
-
addServer
Adds an endpoint.- Parameters:
endpoint- the endpoint to add.- Returns:
trueif the list of endpoints was modified
-
updateServer
Updates an existing endpoint (or adds if missing).- Parameters:
endpoint- the endpoint to update.
-
removeServer
Removes an endpoint.- Parameters:
endpoint- the endpoint to remove.- Returns:
trueif the list of endpoints was modified
-
removeServer
Removes an endpoint.- Parameters:
serverUrl- the server URL to remove.- Returns:
trueif the list of endpoints was modified
-
findServer
Checks to see if the supplied server URL is defined in the global configuration.- Parameters:
serverUrl- the server url to check.- Returns:
- the global configuration for the specified server url or
nullif not defined.
-