Class BitbucketApiFactory

java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApiFactory
All Implemented Interfaces:
ExtensionPoint
Direct Known Subclasses:
BitbucketCloudApiFactory, BitbucketServerApiFactory

public abstract class BitbucketApiFactory extends Object implements ExtensionPoint
Factory for creating BitbucketApi instances to connect to a given server URL.
Since:
2.1.0
  • Constructor Details

    • BitbucketApiFactory

      public BitbucketApiFactory()
  • Method Details

    • isMatch

      protected abstract boolean isMatch(@Nullable String serverUrl)
      Tests if the supplied URL is supported by this factory.
      Parameters:
      serverUrl - the server URL (may be null, e.g. for Bitbucket Cloud)
      Returns:
      true if this factory can connect to the specified URL.
    • create

      @NonNull protected abstract BitbucketApi create(@Nullable String serverUrl, @Nullable BitbucketAuthenticator authenticator, @NonNull String owner, @CheckForNull String projectKey, @CheckForNull String repository)
      Creates a BitbucketApi for the specified URL with the supplied credentials, owner and (optional) repository.
      Parameters:
      serverUrl - the server URL.
      authenticator - the (optional) authenticator.
      owner - the owner name.
      projectKey - the (optional) project key.
      repository - the (optional) repository name.
      Returns:
      the BitbucketApi.
    • create

      @NonNull @Deprecated protected BitbucketApi create(@Nullable String serverUrl, @Nullable com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, @NonNull String owner, @CheckForNull String repository)
      Deprecated.
    • newInstance

      @NonNull public static BitbucketApi newInstance(@Nullable String serverUrl, @Nullable BitbucketAuthenticator authenticator, @NonNull String owner, @CheckForNull String projectKey, @CheckForNull String repository)
      Creates a BitbucketApi for the specified URL with the supplied credentials, owner and (optional) repository.
      Parameters:
      serverUrl - the server URL.
      authenticator - the (optional) authenticator.
      owner - the owner name.
      projectKey - the (optional) project key.
      repository - the (optional) repository name.
      Returns:
      the BitbucketApi.
      Throws:
      IllegalArgumentException - if the supplied URL is not supported.
    • newInstance

      @NonNull @Deprecated public static BitbucketApi newInstance(@Nullable String serverUrl, @Nullable com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, @NonNull String owner, @CheckForNull String projectKey, @CheckForNull String repository)
      Deprecated.