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 aBitbucketCloudEndpoint
or aBitbucketServerEndpoint
.- Since:
- 2.2.0
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description BitbucketAuthenticator
authenticator()
Retrieves theBitbucketAuthenticator
to use for auto-management of hooks.com.cloudbees.plugins.credentials.common.StandardCredentials
credentials()
Looks up theStandardCredentials
to use for auto-management of hooks.String
getBitbucketJenkinsRootUrl()
Jenkins Server Root URL to be used by this Bitbucket endpoint.String
getCredentialsId()
Returns theIdCredentials.getId()
of the credentials to use for auto-management of hooks.AbstractBitbucketEndpointDescriptor
getDescriptor()
abstract String
getDisplayName()
Optional name to use to describe the end-point.String
getEndpointJenkinsRootUrl()
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
getServerUrl()
The URL of this endpoint.boolean
isManageHooks()
Returnstrue
if and only if Jenkins is supposed to auto-manage hooks for this end-point.void
setBitbucketJenkinsRootUrl(String bitbucketJenkinsRootUrl)
-
-
-
Method Detail
-
getDisplayName
@CheckForNull public abstract String getDisplayName()
Optional name to use to describe the end-point.- Returns:
- the name to use for the end-point
-
getServerUrl
@NonNull public abstract String getServerUrl()
The URL of this endpoint.- Returns:
- the URL of the endpoint.
-
getBitbucketJenkinsRootUrl
@CheckForNull public String 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
@DataBoundSetter public void setBitbucketJenkinsRootUrl(String bitbucketJenkinsRootUrl)
-
getEndpointJenkinsRootUrl
@NonNull public String 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
@NonNull public 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. 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
@CheckForNull public final String 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
@CheckForNull public BitbucketAuthenticator authenticator()
Retrieves theBitbucketAuthenticator
to use for auto-management of hooks.- Returns:
- the authenticator or
null
.
-
getDescriptor
public AbstractBitbucketEndpointDescriptor getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<AbstractBitbucketEndpoint>
- Overrides:
getDescriptor
in classAbstractDescribableImpl<AbstractBitbucketEndpoint>
-
-