Class BitbucketSCMSource
- java.lang.Object
-
- hudson.model.AbstractDescribableImpl<jenkins.scm.api.SCMSource>
-
- jenkins.scm.api.SCMSource
-
- com.cloudbees.jenkins.plugins.bitbucket.BitbucketSCMSource
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<jenkins.scm.api.SCMSource>
public class BitbucketSCMSource extends jenkins.scm.api.SCMSource
SCM source implementation for Bitbucket. It provides a way to discover/retrieve branches and pull requests through the Bitbucket REST API which is much faster than the plain Git SCM source implementation.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BitbucketSCMSource.DescriptorImpl
-
Nested classes/interfaces inherited from class jenkins.scm.api.SCMSource
jenkins.scm.api.SCMSource.SourceByItem
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description BitbucketSCMSource(String repoOwner, String repository)
Constructor.BitbucketSCMSource(String id, String repoOwner, String repository)
Deprecated.useBitbucketSCMSource(String, String)
andSCMSource.setId(String)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
afterSave()
SCM
build(jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision)
BitbucketApi
buildBitbucketClient()
BitbucketApi
buildBitbucketClient(PullRequestSCMHead head)
BitbucketApi
buildBitbucketClient(String repoOwner, String repository)
String
getBitbucketServerUrl()
Deprecated.String
getCheckoutCredentialsId()
Deprecated.String
getCredentialsId()
BitbucketSCMSource.DescriptorImpl
getDescriptor()
String
getEndpointJenkinsRootUrl()
static int
getEventDelaySeconds()
Returns how long to delay events received from Bitbucket in order to allow the API caches to sync.String
getExcludes()
Deprecated.String
getIncludes()
Deprecated.String
getRepoOwner()
String
getRepository()
BitbucketRepositoryType
getRepositoryType()
String
getServerUrl()
List<jenkins.scm.api.trait.SCMSourceTrait>
getTraits()
jenkins.scm.api.SCMRevision
getTrustedRevision(jenkins.scm.api.SCMRevision revision, TaskListener listener)
boolean
isAutoRegisterHook()
Deprecated.jenkins.scm.api.SCMHeadOrigin
originOf(String repoOwner, String repository)
protected jenkins.scm.api.SCMRevision
retrieve(jenkins.scm.api.SCMHead head, TaskListener listener)
protected void
retrieve(jenkins.scm.api.SCMSourceCriteria criteria, jenkins.scm.api.SCMHeadObserver observer, jenkins.scm.api.SCMHeadEvent<?> event, TaskListener listener)
protected List<Action>
retrieveActions(jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMHeadEvent event, TaskListener listener)
protected List<Action>
retrieveActions(jenkins.scm.api.SCMSourceEvent event, TaskListener listener)
void
setAutoRegisterHook(boolean autoRegisterHook)
Deprecated.void
setBitbucketServerUrl(String url)
Deprecated.void
setCheckoutCredentialsId(String checkoutCredentialsId)
Deprecated.void
setCredentialsId(String credentialsId)
static void
setEventDelaySeconds(int eventDelaySeconds)
Sets how long to delay events received from Bitbucket in order to allow the API caches to sync.void
setExcludes(String excludes)
Deprecated.void
setIncludes(String includes)
Deprecated.void
setServerUrl(String serverUrl)
void
setTraits(List<jenkins.scm.api.trait.SCMSourceTrait> traits)
-
Methods inherited from class jenkins.scm.api.SCMSource
build, canProbe, checkInterrupt, createProbe, defaultListener, equals, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetch, fetchActions, fetchActions, fetchActions, fetchRevisions, fetchRevisions, fromSCMFileSystem, getCategories, getCriteria, getId, getOwner, getPronoun, hashCode, hasId, isCategoryEnabled, newProbe, parentHeads, parentRevisions, retrieve, retrieve, retrieve, retrieve, retrieve, retrieve, retrieveActions, retrieveRevisions, retrieveRevisions, setId, setOwner, toString, withId
-
-
-
-
Constructor Detail
-
BitbucketSCMSource
@DataBoundConstructor public BitbucketSCMSource(@NonNull String repoOwner, @NonNull String repository)
Constructor.- Parameters:
repoOwner
- the repository owner.repository
- the repository name.- Since:
- 2.2.0
-
BitbucketSCMSource
@Deprecated public BitbucketSCMSource(@CheckForNull String id, @NonNull String repoOwner, @NonNull String repository)
Deprecated.useBitbucketSCMSource(String, String)
andSCMSource.setId(String)
Legacy Constructor.- Parameters:
id
- the id.repoOwner
- the repository owner.repository
- the repository name.
-
-
Method Detail
-
getCredentialsId
@CheckForNull public String getCredentialsId()
-
setCredentialsId
@DataBoundSetter public void setCredentialsId(@CheckForNull String credentialsId)
-
getRepoOwner
@NonNull public String getRepoOwner()
-
getRepository
@NonNull public String getRepository()
-
getServerUrl
@NonNull public String getServerUrl()
-
setServerUrl
@DataBoundSetter public void setServerUrl(@CheckForNull String serverUrl)
-
getEndpointJenkinsRootUrl
@NonNull public String getEndpointJenkinsRootUrl()
-
getTraits
@NonNull public List<jenkins.scm.api.trait.SCMSourceTrait> getTraits()
- Overrides:
getTraits
in classjenkins.scm.api.SCMSource
-
setTraits
@DataBoundSetter public void setTraits(@CheckForNull List<jenkins.scm.api.trait.SCMSourceTrait> traits)
- Overrides:
setTraits
in classjenkins.scm.api.SCMSource
-
setBitbucketServerUrl
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setBitbucketServerUrl(String url)
Deprecated.
-
getBitbucketServerUrl
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @CheckForNull public String getBitbucketServerUrl()
Deprecated.
-
getCheckoutCredentialsId
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @CheckForNull public String getCheckoutCredentialsId()
Deprecated.
-
setCheckoutCredentialsId
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setCheckoutCredentialsId(String checkoutCredentialsId)
Deprecated.
-
getIncludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @NonNull public String getIncludes()
Deprecated.
-
setIncludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setIncludes(@NonNull String includes)
Deprecated.
-
getExcludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @NonNull public String getExcludes()
Deprecated.
-
setExcludes
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setExcludes(@NonNull String excludes)
Deprecated.
-
setAutoRegisterHook
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") @DataBoundSetter public void setAutoRegisterHook(boolean autoRegisterHook)
Deprecated.
-
isAutoRegisterHook
@Deprecated @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) @RestrictedSince("2.2.0") public boolean isAutoRegisterHook()
Deprecated.
-
getRepositoryType
public BitbucketRepositoryType getRepositoryType() throws IOException, InterruptedException
- Throws:
IOException
InterruptedException
-
buildBitbucketClient
public BitbucketApi buildBitbucketClient()
-
buildBitbucketClient
public BitbucketApi buildBitbucketClient(PullRequestSCMHead head)
-
buildBitbucketClient
public BitbucketApi buildBitbucketClient(String repoOwner, String repository)
-
afterSave
public void afterSave()
- Overrides:
afterSave
in classjenkins.scm.api.SCMSource
-
retrieve
protected void retrieve(@CheckForNull jenkins.scm.api.SCMSourceCriteria criteria, @NonNull jenkins.scm.api.SCMHeadObserver observer, @CheckForNull jenkins.scm.api.SCMHeadEvent<?> event, @NonNull TaskListener listener) throws IOException, InterruptedException
- Specified by:
retrieve
in classjenkins.scm.api.SCMSource
- Throws:
IOException
InterruptedException
-
retrieve
protected jenkins.scm.api.SCMRevision retrieve(jenkins.scm.api.SCMHead head, TaskListener listener) throws IOException, InterruptedException
- Overrides:
retrieve
in classjenkins.scm.api.SCMSource
- Throws:
IOException
InterruptedException
-
build
public SCM build(jenkins.scm.api.SCMHead head, jenkins.scm.api.SCMRevision revision)
- Specified by:
build
in classjenkins.scm.api.SCMSource
-
getTrustedRevision
@NonNull public jenkins.scm.api.SCMRevision getTrustedRevision(@NonNull jenkins.scm.api.SCMRevision revision, @NonNull TaskListener listener) throws IOException, InterruptedException
- Overrides:
getTrustedRevision
in classjenkins.scm.api.SCMSource
- Throws:
IOException
InterruptedException
-
getDescriptor
public BitbucketSCMSource.DescriptorImpl getDescriptor()
- Specified by:
getDescriptor
in interfaceDescribable<jenkins.scm.api.SCMSource>
- Overrides:
getDescriptor
in classjenkins.scm.api.SCMSource
-
retrieveActions
@NonNull protected List<Action> retrieveActions(@CheckForNull jenkins.scm.api.SCMSourceEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException
- Overrides:
retrieveActions
in classjenkins.scm.api.SCMSource
- Throws:
IOException
InterruptedException
-
retrieveActions
@NonNull protected List<Action> retrieveActions(@NonNull jenkins.scm.api.SCMHead head, @CheckForNull jenkins.scm.api.SCMHeadEvent event, @NonNull TaskListener listener) throws IOException, InterruptedException
- Overrides:
retrieveActions
in classjenkins.scm.api.SCMSource
- Throws:
IOException
InterruptedException
-
originOf
@NonNull public jenkins.scm.api.SCMHeadOrigin originOf(@NonNull String repoOwner, @NonNull String repository)
-
getEventDelaySeconds
public static int getEventDelaySeconds()
Returns how long to delay events received from Bitbucket in order to allow the API caches to sync.- Returns:
- how long to delay events received from Bitbucket in order to allow the API caches to sync.
-
setEventDelaySeconds
@Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class) public static void setEventDelaySeconds(int eventDelaySeconds)
Sets how long to delay events received from Bitbucket in order to allow the API caches to sync.- Parameters:
eventDelaySeconds
- number of seconds to delay, will be restricted into a value within the range[0,300]
inclusive
-
-