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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract BitbucketApicreate(String serverURL, BitbucketAuthenticator authenticator, String owner, String projectKey, String repository) Creates aBitbucketApifor the specified URL with the supplied credentials, owner and (optional) repository.protected BitbucketApicreate(String serverURL, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials, String owner, String repository) Deprecated.protected abstract booleanTests if the supplied URL is supported by this factory.static BitbucketApinewInstance(String serverURL, BitbucketAuthenticator authenticator, String owner, String projectKey, String repository) Creates aBitbucketApifor the specified URL with the supplied credentials, owner and (optional) repository.
-
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:
trueif 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 aBitbucketApifor 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 aBitbucketApifor 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.
-