Class BitbucketApiFactory

java.lang.Object
io.jenkins.blueocean.blueocean_bitbucket_pipeline.BitbucketApiFactory
All Implemented Interfaces:
ExtensionPoint
Direct Known Subclasses:
BitbucketCloudApi.BitbucketCloudApiFactory, BitbucketServerApi.BitbucketServerApiFactory

public abstract class BitbucketApiFactory extends Object implements ExtensionPoint
Factory for Bitbucket API. Bitbucket server and cloud APIs are different and different factories are needed to handle it
Author:
Vivek Pandey
  • Constructor Details

    • BitbucketApiFactory

      public BitbucketApiFactory()
  • Method Details

    • handles

      public abstract boolean handles(@NonNull String scmId)
      Returns:
      true if this factory can handle this scmId
    • create

      @NonNull public abstract BitbucketApi create(@NonNull String apiUrl, @NonNull com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials)
      Create BitbucketApi instance. Before calling this method, clients must ensure handles(String) is called first and returned true
      Parameters:
      apiUrl - API url (host url) of bitbucket server or cloud. e.g. https://mybitbucketserver.com/
      credentials - StandardUsernamePasswordCredentials
      Returns:
      BitbucketApi instance
    • resolve

      @CheckForNull public static BitbucketApiFactory resolve(@NonNull String scmId)
      Parameters:
      scmId - id Scm.getId() of Bitbucket SCM provider
      Returns:
      BitbucketApiFactory instance, could be null