Class BitbucketEndpointConfiguration
java.lang.Object
hudson.model.Descriptor<GlobalConfiguration>
jenkins.model.GlobalConfiguration
com.cloudbees.jenkins.plugins.bitbucket.endpoints.BitbucketEndpointConfiguration
- All Implemented Interfaces:
ExtensionPoint
,Describable<GlobalConfiguration>
,Saveable
,Loadable
,OnMaster
Represents the global configuration of Bitbucket Cloud and Bitbucket Server endpoints.
- Since:
- 2.2.0
-
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
-
Field Summary
Fields inherited from class hudson.model.Descriptor
clazz
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addEndpoint
(AbstractBitbucketEndpoint endpoint) Adds an endpoint.boolean
configure
(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) findEndpoint
(String serverUrl) Checks to see if the supplied server URL is defined in the global configuration.findEndpoint
(String serverUrl, Class<? extends AbstractBitbucketEndpoint> clazz) Checks to see if the supplied server URL is defined in the global configuration.get()
Gets theBitbucketEndpointConfiguration
singleton.Populates aListBoxModel
with the endpoints.Gets the list of endpoints.boolean
Returnstrue
if and only if there is more than one configured endpoint.static String
normalizeServerUrl
(String serverUrl) Fix a serverUrl.readResolveServerUrl
(String bitbucketServerUrl) Called from areadResolve()
method only to convert the oldbitbucketServerUrl
field into the newserverUrl
field.boolean
removeEndpoint
(AbstractBitbucketEndpoint endpoint) Removes an endpoint.boolean
removeEndpoint
(String serverUrl) Removes an endpoint.void
setEndpoints
(List<? extends AbstractBitbucketEndpoint> endpoints) Sets the list of endpoints.void
updateEndpoint
(AbstractBitbucketEndpoint endpoint) Updates an existing endpoint (or adds if missing).Methods inherited from class jenkins.model.GlobalConfiguration
all, configure, getDescriptor, getGlobalConfigPage
Methods 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, getStaticHelpUrl, getStaticHelpUrl, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
-
Constructor Details
-
BitbucketEndpointConfiguration
public BitbucketEndpointConfiguration()Constructor.
-
-
Method Details
-
get
Gets theBitbucketEndpointConfiguration
singleton.- Returns:
- the
BitbucketEndpointConfiguration
singleton.
-
getRequiredGlobalConfigPagePermission
- Overrides:
getRequiredGlobalConfigPagePermission
in classDescriptor<GlobalConfiguration>
-
readResolveServerUrl
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public String readResolveServerUrl(@CheckForNull String bitbucketServerUrl) Called from areadResolve()
method only to convert the oldbitbucketServerUrl
field into the newserverUrl
field. When called fromACL.SYSTEM
this will update the configuration with the missing definitions of resolved URLs.- Parameters:
bitbucketServerUrl
- the value of the old url field.- Returns:
- the value of the new url field.
-
isEndpointSelectable
public boolean isEndpointSelectable()Returnstrue
if and only if there is more than one configured endpoint.- Returns:
true
if and only if there is more than one configured endpoint.
-
getEndpointItems
Populates aListBoxModel
with the endpoints.- Returns:
- A
ListBoxModel
with all the endpoints
-
configure
public boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException - Overrides:
configure
in classGlobalConfiguration
- Throws:
Descriptor.FormException
-
getEndpoints
Gets the list of endpoints.- Returns:
- the list of endpoints
-
setEndpoints
Sets the list of endpoints.- Parameters:
endpoints
- the list of endpoints.
-
addEndpoint
Adds an endpoint.- Parameters:
endpoint
- the endpoint to add.- Returns:
true
if the list of endpoints was modified
-
updateEndpoint
Updates an existing endpoint (or adds if missing).- Parameters:
endpoint
- the endpoint to update.
-
removeEndpoint
Removes an endpoint.- Parameters:
endpoint
- the endpoint to remove.- Returns:
true
if the list of endpoints was modified
-
removeEndpoint
Removes an endpoint.- Parameters:
serverUrl
- the server URL to remove.- Returns:
true
if the list of endpoints was modified
-
findEndpoint
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
null
if not defined.
-
findEndpoint
public Optional<AbstractBitbucketEndpoint> findEndpoint(@CheckForNull String serverUrl, Class<? extends AbstractBitbucketEndpoint> clazz) Checks to see if the supplied server URL is defined in the global configuration.- Parameters:
serverUrl
- the server url to check.clazz
- the class to check.- Returns:
- the global configuration for the specified server url or
null
if not defined.
-
normalizeServerUrl
Fix a serverUrl.- Parameters:
serverUrl
- the server URL.- Returns:
- the normalized server URL.
-