@Extension public class BitbucketEndpointConfiguration extends GlobalConfiguration
Descriptor.FormException, Descriptor.PropertyType, Descriptor.Self
ExtensionPoint.LegacyInstancesAreScopedToHudson
clazz
Constructor and Description |
---|
BitbucketEndpointConfiguration()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addEndpoint(AbstractBitbucketEndpoint endpoint)
Adds an endpoint.
|
boolean |
configure(org.kohsuke.stapler.StaplerRequest req,
net.sf.json.JSONObject json) |
AbstractBitbucketEndpoint |
findEndpoint(String serverUrl)
Checks to see if the supplied server URL is defined in the global configuration.
|
Optional<AbstractBitbucketEndpoint> |
findEndpoint(String serverUrl,
Class<? extends AbstractBitbucketEndpoint> clazz)
Checks to see if the supplied server URL is defined in the global configuration.
|
static BitbucketEndpointConfiguration |
get()
Gets the
BitbucketEndpointConfiguration singleton. |
ListBoxModel |
getEndpointItems()
Populates a
ListBoxModel with the endpoints. |
List<AbstractBitbucketEndpoint> |
getEndpoints()
Gets the list of endpoints.
|
boolean |
isEndpointSelectable()
Returns
true if and only if there is more than one configured endpoint. |
static String |
normalizeServerUrl(String serverUrl)
Fix a serverUrl.
|
String |
readResolveServerUrl(String bitbucketServerUrl)
Called from a
readResolve() method only to convert the old bitbucketServerUrl field into the new
serverUrl 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).
|
all, getDescriptor, getGlobalConfigPage
addHelpFileRedirect, calcAutoCompleteSettings, calcFillSettings, configure, 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, getT, getViewPage, isInstance, isSubTypeOf, load, newInstance, newInstance, newInstancesFromHeteroList, newInstancesFromHeteroList, save, self, toArray, toList, toMap
public BitbucketEndpointConfiguration()
public static BitbucketEndpointConfiguration get()
BitbucketEndpointConfiguration
singleton.BitbucketEndpointConfiguration
singleton.@Restricted(value=org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public String readResolveServerUrl(@CheckForNull String bitbucketServerUrl)
readResolve()
method only to convert the old bitbucketServerUrl
field into the new
serverUrl
field. When called from ACL.SYSTEM
this will update the configuration with the
missing definitions of resolved URLs.bitbucketServerUrl
- the value of the old url field.public boolean isEndpointSelectable()
true
if and only if there is more than one configured endpoint.true
if and only if there is more than one configured endpoint.public ListBoxModel getEndpointItems()
ListBoxModel
with the endpoints.ListBoxModel
with all the endpointspublic boolean configure(org.kohsuke.stapler.StaplerRequest req, net.sf.json.JSONObject json) throws Descriptor.FormException
configure
in class GlobalConfiguration
Descriptor.FormException
@NonNull public List<AbstractBitbucketEndpoint> getEndpoints()
public void setEndpoints(@CheckForNull List<? extends AbstractBitbucketEndpoint> endpoints)
endpoints
- the list of endpoints.public boolean addEndpoint(@NonNull AbstractBitbucketEndpoint endpoint)
endpoint
- the endpoint to add.true
if the list of endpoints was modifiedpublic void updateEndpoint(@NonNull AbstractBitbucketEndpoint endpoint)
endpoint
- the endpoint to update.public boolean removeEndpoint(@NonNull AbstractBitbucketEndpoint endpoint)
endpoint
- the endpoint to remove.true
if the list of endpoints was modifiedpublic boolean removeEndpoint(@CheckForNull String serverUrl)
serverUrl
- the server URL to remove.true
if the list of endpoints was modified@CheckForNull public AbstractBitbucketEndpoint findEndpoint(@CheckForNull String serverUrl)
serverUrl
- the server url to check.null
if not defined.public Optional<AbstractBitbucketEndpoint> findEndpoint(@CheckForNull String serverUrl, Class<? extends AbstractBitbucketEndpoint> clazz)
serverUrl
- the server url to check.clazz
- the class to check.null
if not defined.Copyright © 2016–2022. All rights reserved.