Class AbstractBitbucketEndpoint

java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.endpoints.AbstractBitbucketEndpoint
All Implemented Interfaces:
BitbucketEndpoint, Describable<BitbucketEndpoint>
Direct Known Subclasses:
BitbucketCloudEndpoint, BitbucketServerEndpoint

public abstract class AbstractBitbucketEndpoint extends Object implements BitbucketEndpoint
Since:
2.2.0
  • Method Details

    • getServerUrl

      @Deprecated(since="936.4.0", forRemoval=true) @NonNull public abstract String getServerUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      The URL of this endpoint.
      Returns:
      the URL of the endpoint.
    • getBitbucketJenkinsRootUrl

      @Deprecated(since="936.4.0", forRemoval=true) @CheckForNull public String getBitbucketJenkinsRootUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Jenkins Server Root URL to be used by this Bitbucket endpoint. The global setting from Jenkins.get().getRootUrl() will be used if this field is null or equals an empty string.
      Returns:
      the verbatim setting provided by endpoint configuration
    • getEndpointJenkinsRootURL

      public String getEndpointJenkinsRootURL()
      Description copied from interface: BitbucketEndpoint
      Jenkins Server Root URL to be used by this Bitbucket endpoint. The global setting from Jenkins.get().getRootUrl() will be used if this field is null or equals an empty string.
      Specified by:
      getEndpointJenkinsRootURL in interface BitbucketEndpoint
      Returns:
      the verbatim setting provided by endpoint configuration
    • getRepositoryURL

      @NonNull public String getRepositoryURL(@NonNull String repoOwner, @NonNull String repoSlug)
      Description copied from interface: BitbucketEndpoint
      The user facing URL of the specified repository.
      Specified by:
      getRepositoryURL in interface BitbucketEndpoint
      Parameters:
      repoOwner - the repository owner.
      repoSlug - the repository name
      Returns:
      the user facing URL of the specified repository.
    • setBitbucketJenkinsRootUrl

      @DataBoundSetter public void setBitbucketJenkinsRootUrl(String bitbucketJenkinsRootUrl)
    • getHookSignatureCredentialsId

      @CheckForNull public String getHookSignatureCredentialsId()
      Description copied from interface: BitbucketEndpoint
      The IdCredentials.getId() of the credentials to use to verify the signature of hooks.
      Specified by:
      getHookSignatureCredentialsId in interface BitbucketEndpoint
      Returns:
      the configured credentials identifier to use
    • isEnableHookSignature

      public boolean isEnableHookSignature()
      Specified by:
      isEnableHookSignature in interface BitbucketEndpoint
    • getEndpointJenkinsRootUrl

      @Deprecated(since="936.4.0", forRemoval=true) @NonNull public String getEndpointJenkinsRootUrl()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Jenkins Server Root URL to be used by this Bitbucket endpoint. The global setting from Jenkins.get().getRootUrl() will be used if this field is null or equals an empty string.
      Returns:
      the normalized value from setting provided by endpoint configuration (if not empty), or the global setting of the Jenkins Root URL
    • getEndpointJenkinsRootUrl

      @NonNull public static String getEndpointJenkinsRootUrl(String serverURL)
      Look up in the current endpoint configurations if one exists for the serverUrl, and return its normalized endpointJenkinsRootUrl value, or the normalized global default Jenkins Root URL if nothing was found or if the setting is an empty string; empty string if there was an error finding the global default Jenkins Root URL value (e.g. core not started). This is the routine intended for external consumption when one needs a Jenkins Root URL to use for webhook configuration.
      Parameters:
      serverURL - Bitbucket Server URL for the endpoint config
      Returns:
      the normalized custom or default Jenkins Root URL value
    • getRepositoryUrl

      @NonNull public abstract String getRepositoryUrl(@NonNull String repoOwner, @NonNull String repository)
      The user facing URL of the specified repository.
      Parameters:
      repoOwner - the repository owner.
      repository - the repository.
      Returns:
      the user facing URL of the specified repository.
    • isManageHooks

      public final boolean isManageHooks()
      Returns true if and only if Jenkins is supposed to auto-manage hooks for this end-point.
      Specified by:
      isManageHooks in interface BitbucketEndpoint
      Returns:
      true if and only if Jenkins is supposed to auto-manage hooks for this end-point.
    • getCredentialsId

      @CheckForNull public final String getCredentialsId()
      Returns the IdCredentials.getId() of the credentials to use for auto-management of hooks.
      Specified by:
      getCredentialsId in interface BitbucketEndpoint
      Returns:
      the IdCredentials.getId() of the credentials to use for auto-management of hooks.
    • credentials

      @CheckForNull public com.cloudbees.plugins.credentials.common.StandardCredentials credentials()
      Looks up the StandardCredentials to use for auto-management of hooks.
      Specified by:
      credentials in interface BitbucketEndpoint
      Returns:
      the credentials or null.
    • hookSignatureCredentials

      @CheckForNull public org.jenkinsci.plugins.plaincredentials.StringCredentials hookSignatureCredentials()
      Looks up the StringCredentials to use to verify the signature of hooks.
      Specified by:
      hookSignatureCredentials in interface BitbucketEndpoint
      Returns:
      the credentials or null.
    • authenticator

      @CheckForNull public BitbucketAuthenticator authenticator()
      Retrieves the BitbucketAuthenticator to use for auto-management of hooks.
      Returns:
      the authenticator or null.
    • getDescriptor

      public AbstractBitbucketEndpointDescriptor getDescriptor()
      Specified by:
      getDescriptor in interface BitbucketEndpoint
      Specified by:
      getDescriptor in interface Describable<BitbucketEndpoint>
      See Also: