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 creatingBitbucketApi
instances to connect to a given serverURL
.- Since:
- 2.1.0
-
-
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 Deprecated Methods Modifier and Type Method Description protected abstract BitbucketApi
create(String serverUrl, BitbucketAuthenticator authenticator, String owner, String projectKey, String repository)
Creates aBitbucketApi
for the specified URL with the supplied credentials, owner and (optional) repository.protected BitbucketApi
create(String serverUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, String owner, String repository)
Deprecated.protected abstract boolean
isMatch(String serverUrl)
Tests if the supplied URL is supported by this factory.static BitbucketApi
newInstance(String serverUrl, BitbucketAuthenticator authenticator, String owner, String projectKey, String repository)
Creates aBitbucketApi
for the specified URL with the supplied credentials, owner and (optional) repository.static BitbucketApi
newInstance(String serverUrl, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, String owner, String projectKey, String repository)
Deprecated.
-
-
-
Method Detail
-
isMatch
protected abstract boolean isMatch(@Nullable String serverUrl)
Tests if the supplied URL is supported by this factory.- Parameters:
serverUrl
- the server URL (may benull
, 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 aBitbucketApi
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 aBitbucketApi
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.
-
-