Class AbstractBitbucketScm

java.lang.Object
io.jenkins.blueocean.rest.model.Resource
io.jenkins.blueocean.rest.impl.pipeline.scm.Scm
io.jenkins.blueocean.rest.impl.pipeline.scm.AbstractScm
io.jenkins.blueocean.blueocean_bitbucket_pipeline.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
  • Field Summary

    Fields inherited from class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm

    CREDENTIAL_ID, ID, URI, VALIDATE, X_CREDENTIAL_ID
  • Constructor Summary

    Constructors
    Constructor
    Description
    AbstractBitbucketScm(io.jenkins.blueocean.rest.Reachable parent)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected abstract String
    Caller must ensure apiUrl is not blank or null
    getApi(String apiUrl, String scmId, com.cloudbees.plugins.credentials.common.StandardUsernamePasswordCredentials credentials)
     
    protected String
     
     
    protected abstract String
     
    io.jenkins.blueocean.rest.hal.Link
     
    io.jenkins.blueocean.rest.model.Container<io.jenkins.blueocean.rest.impl.pipeline.scm.ScmOrganization>
     
    protected org.kohsuke.stapler.StaplerRequest
     
     
     
    static String
     
    org.kohsuke.stapler.HttpResponse
    validateAndCreate(net.sf.json.JSONObject request)
    Request payload: { "userName": "joe", "password":"****", "apiUrl":"mybitbucketserver.com" }

    Methods inherited from class io.jenkins.blueocean.rest.impl.pipeline.scm.AbstractScm

    checkPermission, createResponse, getAuthenticatedUser, getCredentialIdFromRequest, getRootOrgFolder

    Methods inherited from class io.jenkins.blueocean.rest.impl.pipeline.scm.Scm

    getId, getServers

    Methods inherited from class io.jenkins.blueocean.rest.model.Resource

    getLinks

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • AbstractBitbucketScm

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

    • 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
    • getDomainId

      @NonNull protected abstract String getDomainId()
    • getStaplerRequest

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

      @NonNull protected String getApiUrlParameter()
    • normalizeApiUrl

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