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

@Extension public class BitbucketEndpointConfiguration extends GlobalConfiguration
Represents the global configuration of Bitbucket Cloud and Bitbucket Server endpoints.
Since:
2.2.0
  • Constructor Details

    • BitbucketEndpointConfiguration

      public BitbucketEndpointConfiguration()
      Constructor.
  • Method Details

    • get

      public static BitbucketEndpointConfiguration get()
      Gets the BitbucketEndpointConfiguration singleton.
      Returns:
      the BitbucketEndpointConfiguration singleton.
    • getRequiredGlobalConfigPagePermission

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

      @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @NonNull public String readResolveServerUrl(@CheckForNull String serverURL)
      Called from a 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.
      Parameters:
      serverURL - the value of the old url field.
      Returns:
      the value of the new url field.
    • isEndpointSelectable

      public boolean isEndpointSelectable()
      Returns true 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

      @Deprecated public ListBoxModel getEndpointItems()
      Deprecated.
      Populates a ListBoxModel with the endpoints.
      Returns:
      A ListBoxModel with all the endpoints
    • configure

      public boolean configure(org.kohsuke.stapler.StaplerRequest2 req, net.sf.json.JSONObject json) throws Descriptor.FormException
      Overrides:
      configure in class GlobalConfiguration
      Throws:
      Descriptor.FormException
    • getEndpoints

      @NonNull public List<AbstractBitbucketEndpoint> getEndpoints()
      Gets the list of endpoints.
      Returns:
      the list of endpoints
    • setEndpoints

      public void setEndpoints(@CheckForNull List<? extends BitbucketEndpoint> endpoints)
      Sets the list of endpoints.
      Parameters:
      endpoints - the list of endpoints.
    • addEndpoint

      public boolean addEndpoint(@NonNull BitbucketEndpoint endpoint)
      Adds an endpoint.
      Parameters:
      endpoint - the endpoint to add.
      Returns:
      true if the list of endpoints was modified
    • updateEndpoint

      public void updateEndpoint(@NonNull BitbucketEndpoint endpoint)
      Updates an existing endpoint (or adds if missing).
      Parameters:
      endpoint - the endpoint to update.
    • removeEndpoint

      public boolean removeEndpoint(@NonNull BitbucketEndpoint endpoint)
      Removes an endpoint.
      Parameters:
      endpoint - the endpoint to remove.
      Returns:
      true if the list of endpoints was modified
    • removeEndpoint

      public boolean removeEndpoint(@CheckForNull String serverURL)
      Removes an endpoint.
      Parameters:
      serverURL - the server URL to remove.
      Returns:
      true if the list of endpoints was modified
    • getDefaultEndpoint

      @NonNull public BitbucketEndpoint getDefaultEndpoint()
    • normalizeServerUrl

      @CheckForNull @Deprecated(forRemoval=true) public static String normalizeServerUrl(@CheckForNull String serverURL)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Do not use at all, endpoint URL are already managed internally
      Fix a serverUrl.
      Parameters:
      serverURL - the server URL.
      Returns:
      the normalized server URL.