Class AbstractBitbucketEndpoint
java.lang.Object
hudson.model.AbstractDescribableImpl<AbstractBitbucketEndpoint>
com.cloudbees.jenkins.plugins.bitbucket.endpoints.AbstractBitbucketEndpoint
- All Implemented Interfaces:
Describable<AbstractBitbucketEndpoint>
- Direct Known Subclasses:
BitbucketCloudEndpoint
,BitbucketServerEndpoint
public abstract class AbstractBitbucketEndpoint
extends AbstractDescribableImpl<AbstractBitbucketEndpoint>
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.Jenkins Server Root URL to be used by this Bitbucket endpoint.final String
Returns theIdCredentials.getId()
of the credentials to use for auto-management of hooks.abstract String
Optional name to use to describe the end-point.Jenkins Server Root URL to be used by this Bitbucket endpoint.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.abstract String
getRepositoryUrl
(String repoOwner, String repository) The user facing URL of the specified repository.abstract String
The URL of this endpoint.final boolean
Returnstrue
if and only if Jenkins is supposed to auto-manage hooks for this end-point.void
setBitbucketJenkinsRootUrl
(String bitbucketJenkinsRootUrl)
-
Method Details
-
getDisplayName
Optional name to use to describe the end-point.- Returns:
- the name to use for the end-point
-
getServerUrl
The URL of this endpoint.- Returns:
- the URL of the endpoint.
-
getBitbucketJenkinsRootUrl
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
-
setBitbucketJenkinsRootUrl
-
getEndpointJenkinsRootUrl
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.- 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.- 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.- 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 interfaceDescribable<AbstractBitbucketEndpoint>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<AbstractBitbucketEndpoint>
-