Class AbstractBitbucketApi
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi
- All Implemented Interfaces:
- BitbucketApi,- AutoCloseable
- Direct Known Subclasses:
- BitbucketCloudApiClient,- BitbucketServerAPIClient
@Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
public abstract class AbstractBitbucketApi
extends Object
implements BitbucketApi, AutoCloseable
- 
Field SummaryFields
- 
Constructor SummaryConstructorsModifierConstructorDescriptionprotectedAbstractBitbucketApi(BitbucketAuthenticator authenticator) 
- 
Method SummaryModifier and TypeMethodDescription<T> TAdapt this implementation to the given class.protected BitbucketRequestExceptionbuildResponseException(org.apache.hc.core5.http.ClassicHttpResponse response, String errorMessage) voidclose()protected static org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilderprotected StringdeleteRequest(String path) protected org.apache.hc.core5.http.ClassicHttpResponseexecuteMethod(org.apache.hc.client5.http.classic.methods.HttpUriRequest request) protected BitbucketAuthenticatorprotected abstract Stringprotected abstract org.apache.hc.client5.http.impl.classic.CloseableHttpClientprotected abstract org.apache.hc.client5.http.io.HttpClientConnectionManagerprotected abstract org.apache.hc.core5.http.HttpHostgetHost()protected StringgetRequest(String path) protected InputStreamprotected StringgetResponseContent(org.apache.hc.core5.http.ClassicHttpResponse response) List<? extends BitbucketWebHook>Returns the webhooks defined in the repository.protected intheadRequestStatus(String path) protected abstract booleanisSupportedAuthenticator(BitbucketAuthenticator authenticator) Implementation must validate if the configured authenticator is supported by this client implementation.protected StringpostRequest(String path, String content) protected StringpostRequest(String path, List<? extends org.apache.hc.core5.http.NameValuePair> params) protected StringputRequest(String path, String content) voidRegister a webhook on the repository.voidRemove the webhook (ID field required) from the repository.protected voidsetClientProxyParams(org.apache.hc.client5.http.impl.classic.HttpClientBuilder builder) protected org.apache.hc.client5.http.impl.classic.HttpClientBuildervoidUpdate a webhook on the repository.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.cloudbees.jenkins.plugins.bitbucket.api.BitbucketApicheckPathExists, getAvatar, getBranch, getBranches, getCommits, getDefaultBranch, getDirectoryContent, getFile, getFileContent, getOwner, getPullRequestById, getPullRequests, getRepositories, getRepositories, getRepository, getRepositoryName, getTag, getTags, getTeam, getTeamAvatar, isPrivate, postBuildStatus, postCommitComment, resolveCommit, resolveCommit, resolveSourceFullHash
- 
Field Details- 
logger
 
- 
- 
Constructor Details- 
AbstractBitbucketApi
 
- 
- 
Method Details- 
buildResponseExceptionprotected BitbucketRequestException buildResponseException(org.apache.hc.core5.http.ClassicHttpResponse response, String errorMessage) 
- 
getResponseContentprotected String getResponseContent(org.apache.hc.core5.http.ClassicHttpResponse response) throws IOException - Throws:
- IOException
 
- 
connectionManagerBuilderprotected static org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManagerBuilder connectionManagerBuilder()
- 
setupClientBuilderprotected org.apache.hc.client5.http.impl.classic.HttpClientBuilder setupClientBuilder()
- 
setClientProxyParamsprotected void setClientProxyParams(org.apache.hc.client5.http.impl.classic.HttpClientBuilder builder) 
- 
isSupportedAuthenticatorprotected abstract boolean isSupportedAuthenticator(@CheckForNull BitbucketAuthenticator authenticator) Implementation must validate if the configured authenticator is supported by this client implementation.
- 
getConnectionManager@CheckForNull protected abstract org.apache.hc.client5.http.io.HttpClientConnectionManager getConnectionManager()
- 
getHost@NonNull protected abstract org.apache.hc.core5.http.HttpHost getHost()
- 
getBaseURL
- 
getClient@NonNull protected abstract org.apache.hc.client5.http.impl.classic.CloseableHttpClient getClient()
- 
executeMethodprotected org.apache.hc.core5.http.ClassicHttpResponse executeMethod(org.apache.hc.client5.http.classic.methods.HttpUriRequest request) throws IOException - Throws:
- IOException
 
- 
getRequestAsInputStream- Throws:
- IOException
 
- 
headRequestStatus- Throws:
- IOException
 
- 
getRequest- Throws:
- IOException
 
- 
postRequestprotected String postRequest(String path, List<? extends org.apache.hc.core5.http.NameValuePair> params) throws IOException - Throws:
- IOException
 
- 
postRequest- Throws:
- IOException
 
- 
putRequest- Throws:
- IOException
 
- 
deleteRequest- Throws:
- IOException
 
- 
closeDescription copied from interface:BitbucketApi- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- BitbucketApi
- Throws:
- IOException
 
- 
getAuthenticator
- 
getWebHooksDescription copied from interface:BitbucketApiReturns the webhooks defined in the repository.- Specified by:
- getWebHooksin interface- BitbucketApi
- Returns:
- the list of webhooks registered in the repository.
- Throws:
- IOException- if there was a network communications error.
 
- 
registerCommitWebHookDescription copied from interface:BitbucketApiRegister a webhook on the repository.- Specified by:
- registerCommitWebHookin interface- BitbucketApi
- Parameters:
- hook- the webhook object
- Throws:
- IOException- if there was a network communications error.
 
- 
updateCommitWebHookDescription copied from interface:BitbucketApiUpdate a webhook on the repository.- Specified by:
- updateCommitWebHookin interface- BitbucketApi
- Parameters:
- hook- the webhook object
- Throws:
- IOException- if there was a network communications error.
 
- 
removeCommitWebHookDescription copied from interface:BitbucketApiRemove the webhook (ID field required) from the repository.- Specified by:
- removeCommitWebHookin interface- BitbucketApi
- Parameters:
- hook- the webhook object
- Throws:
- IOException- if there was a network communications error.
 
- 
adaptDescription copied from interface:BitbucketApiAdapt this implementation to the given class.- Specified by:
- adaptin interface- BitbucketApi
- Type Parameters:
- T- the return type
- Parameters:
- clazz- of type T to adapt to
- Returns:
- the adapted class or nullif given class is not supported.
 
 
-