Class AbstractBitbucketScm

  • All Implemented Interfaces:
    io.jenkins.blueocean.rest.Reachable
    Direct Known Subclasses:
    BitbucketCloudScm, BitbucketServerScm

    public abstract class AbstractBitbucketScm
    extends io.jenkins.blueocean.rest.impl.pipeline.scm.AbstractScm
    Author:
    Vivek Pandey
    • Constructor Detail

      • AbstractBitbucketScm

        public AbstractBitbucketScm​(io.jenkins.blueocean.rest.Reachable parent)
    • Method Detail

      • getState

        public Object getState()
        Overrides:
        getState in class io.jenkins.blueocean.rest.model.Resource
      • getLink

        public io.jenkins.blueocean.rest.hal.Link getLink()
      • getUri

        @Nonnull
        public String getUri()
        Specified by:
        getUri in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
      • getCredentialId

        public String getCredentialId()
        Specified by:
        getCredentialId in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
      • getOrganizations

        public io.jenkins.blueocean.rest.model.Container<io.jenkins.blueocean.rest.impl.pipeline.scm.ScmOrganization> getOrganizations()
        Specified by:
        getOrganizations in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
      • validateAndCreate

        public org.kohsuke.stapler.HttpResponse validateAndCreate​(@JsonBody
                                                                  net.sf.json.JSONObject request)
        Request payload: { "userName": "joe", "password":"****", "apiUrl":"mybitbucketserver.com" }
        Specified by:
        validateAndCreate in class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
        Parameters:
        request - userName and password of bitbucket server
        Returns:
        credential id
      • getApi

        public static BitbucketApi getApi​(String apiUrl,
                                          String scmId,
                                          com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials)
      • createCredentialId

        @Nonnull
        protected abstract String createCredentialId​(@Nonnull
                                                     String apiUrl)
        Caller must ensure apiUrl is not blank or null
        Parameters:
        apiUrl - must be normalized url using BitbucketEndpointConfiguration.normalizeServerUrl(String)
        Returns:
        url
      • getStaplerRequest

        protected org.kohsuke.stapler.StaplerRequest getStaplerRequest()
      • normalizeApiUrl

        @Restricted(org.kohsuke.accmod.restrictions.NoExternalUse.class)
        @Nonnull
        public static String normalizeApiUrl​(@Nonnull
                                             String apiUrl)