Class BitbucketApiFactory
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApiFactory
- All Implemented Interfaces:
ExtensionPoint
- Direct Known Subclasses:
BitbucketCloudApiFactory
,BitbucketServerApiFactory
Factory for creating
BitbucketApi
instances to connect to a given server URL
.- Since:
- 2.1.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected 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
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.
-
Constructor Details
-
BitbucketApiFactory
public BitbucketApiFactory()
-
-
Method Details
-
isMatch
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.
-