Class AbstractBitbucketEndpoint
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.endpoints.AbstractBitbucketEndpoint
- All Implemented Interfaces:
BitbucketEndpoint
,Describable<BitbucketEndpoint>
- Direct Known Subclasses:
BitbucketCloudEndpoint
,BitbucketServerEndpoint
Represents a
BitbucketCloudEndpoint
or a BitbucketServerEndpoint
.- Since:
- 2.2.0
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves theBitbucketAuthenticator
to use for auto-management of hooks.com.cloudbees.plugins.credentials.common.StandardCredentials
Looks up theStandardCredentials
to use for auto-management of hooks.Deprecated, for removal: This API element is subject to removal in a future version.final String
Returns theIdCredentials.getId()
of the credentials to use for auto-management of hooks.Deprecated, for removal: This API element is subject to removal in a future version.static String
getEndpointJenkinsRootUrl
(String serverURL) Look up in the current endpoint configurations if one exists for the serverUrl, and return its normalized endpointJenkinsRootUrl value, or the normalized global default Jenkins Root URL if nothing was found or if the setting is an empty string; empty string if there was an error finding the global default Jenkins Root URL value (e.g.Jenkins Server Root URL to be used by this Bitbucket endpoint.TheIdCredentials.getId()
of the credentials to use to verify the signature of hooks.abstract String
getRepositoryUrl
(String repoOwner, String repository) The user facing URL of the specified repository.getRepositoryURL
(String repoOwner, String repoSlug) The user facing URL of the specified repository.abstract String
Deprecated, for removal: This API element is subject to removal in a future version.UseBitbucketEndpoint.getServerURL()
instead of this.org.jenkinsci.plugins.plaincredentials.StringCredentials
Looks up theStringCredentials
to use to verify the signature of hooks.boolean
final boolean
Returnstrue
if and only if Jenkins is supposed to auto-manage hooks for this end-point.void
setBitbucketJenkinsRootUrl
(String bitbucketJenkinsRootUrl) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.endpoint.BitbucketEndpoint
getDisplayName, getServerURL, getType, isEquals
-
Method Details
-
getServerUrl
Deprecated, for removal: This API element is subject to removal in a future version.UseBitbucketEndpoint.getServerURL()
instead of this.The URL of this endpoint.- Returns:
- the URL of the endpoint.
-
getBitbucketJenkinsRootUrl
@Deprecated(since="936.4.0", forRemoval=true) @CheckForNull public String getBitbucketJenkinsRootUrl()Deprecated, for removal: This API element is subject to removal in a future version.Jenkins Server Root URL to be used by this Bitbucket endpoint. The global setting from Jenkins.get().getRootUrl() will be used if this field is null or equals an empty string.- Returns:
- the verbatim setting provided by endpoint configuration
-
getEndpointJenkinsRootURL
Description copied from interface:BitbucketEndpoint
Jenkins Server Root URL to be used by this Bitbucket endpoint. The global setting from Jenkins.get().getRootUrl() will be used if this field is null or equals an empty string.- Specified by:
getEndpointJenkinsRootURL
in interfaceBitbucketEndpoint
- Returns:
- the verbatim setting provided by endpoint configuration
-
getRepositoryURL
Description copied from interface:BitbucketEndpoint
The user facing URL of the specified repository.- Specified by:
getRepositoryURL
in interfaceBitbucketEndpoint
- Parameters:
repoOwner
- the repository owner.repoSlug
- the repository name- Returns:
- the user facing URL of the specified repository.
-
setBitbucketJenkinsRootUrl
-
getHookSignatureCredentialsId
Description copied from interface:BitbucketEndpoint
TheIdCredentials.getId()
of the credentials to use to verify the signature of hooks.- Specified by:
getHookSignatureCredentialsId
in interfaceBitbucketEndpoint
- Returns:
- the configured credentials identifier to use
-
isEnableHookSignature
public boolean isEnableHookSignature()- Specified by:
isEnableHookSignature
in interfaceBitbucketEndpoint
-
getEndpointJenkinsRootUrl
Deprecated, for removal: This API element is subject to removal in a future version.UseBitbucketEndpoint.getEndpointJenkinsRootURL()
instead of this.Jenkins Server Root URL to be used by this Bitbucket endpoint. The global setting from Jenkins.get().getRootUrl() will be used if this field is null or equals an empty string.- Returns:
- the normalized value from setting provided by endpoint configuration (if not empty), or the global setting of the Jenkins Root URL
-
getEndpointJenkinsRootUrl
Look up in the current endpoint configurations if one exists for the serverUrl, and return its normalized endpointJenkinsRootUrl value, or the normalized global default Jenkins Root URL if nothing was found or if the setting is an empty string; empty string if there was an error finding the global default Jenkins Root URL value (e.g. core not started). This is the routine intended for external consumption when one needs a Jenkins Root URL to use for webhook configuration.- Parameters:
serverURL
- Bitbucket Server URL for the endpoint config- Returns:
- the normalized custom or default Jenkins Root URL value
-
getRepositoryUrl
@NonNull public abstract String getRepositoryUrl(@NonNull String repoOwner, @NonNull String repository) The user facing URL of the specified repository.- Parameters:
repoOwner
- the repository owner.repository
- the repository.- Returns:
- the user facing URL of the specified repository.
-
isManageHooks
public final boolean isManageHooks()Returnstrue
if and only if Jenkins is supposed to auto-manage hooks for this end-point.- Specified by:
isManageHooks
in interfaceBitbucketEndpoint
- Returns:
true
if and only if Jenkins is supposed to auto-manage hooks for this end-point.
-
getCredentialsId
Returns theIdCredentials.getId()
of the credentials to use for auto-management of hooks.- Specified by:
getCredentialsId
in interfaceBitbucketEndpoint
- Returns:
- the
IdCredentials.getId()
of the credentials to use for auto-management of hooks.
-
credentials
@CheckForNull public com.cloudbees.plugins.credentials.common.StandardCredentials credentials()Looks up theStandardCredentials
to use for auto-management of hooks.- Specified by:
credentials
in interfaceBitbucketEndpoint
- Returns:
- the credentials or
null
.
-
hookSignatureCredentials
@CheckForNull public org.jenkinsci.plugins.plaincredentials.StringCredentials hookSignatureCredentials()Looks up theStringCredentials
to use to verify the signature of hooks.- Specified by:
hookSignatureCredentials
in interfaceBitbucketEndpoint
- Returns:
- the credentials or
null
.
-
authenticator
Retrieves theBitbucketAuthenticator
to use for auto-management of hooks.- Returns:
- the authenticator or
null
.
-
getDescriptor
- Specified by:
getDescriptor
in interfaceBitbucketEndpoint
- Specified by:
getDescriptor
in interfaceDescribable<BitbucketEndpoint>
- See Also:
-
BitbucketEndpoint.getEndpointJenkinsRootURL()
instead of this.