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
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description BitbucketApiFactory()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract BitbucketApi
create(String apiUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials)
CreateBitbucketApi
instance.abstract boolean
handles(String scmId)
static BitbucketApiFactory
resolve(String scmId)
Resolves aBitbucketApiFactory
-
-
-
Method Detail
-
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)
CreateBitbucketApi
instance. Before calling this method, clients must ensurehandles(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)
Resolves aBitbucketApiFactory
- Parameters:
scmId
- idScm.getId()
of Bitbucket SCM provider- Returns:
BitbucketApiFactory
instance, could be null
-
-