Class AbstractBitbucketApi
java.lang.Object
com.cloudbees.jenkins.plugins.bitbucket.impl.client.AbstractBitbucketApi
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
BitbucketCloudApiClient
,BitbucketServerAPIClient
@Restricted(org.kohsuke.accmod.restrictions.ProtectedExternally.class)
public abstract class AbstractBitbucketApi
extends Object
implements AutoCloseable
-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractBitbucketApi
(BitbucketAuthenticator authenticator) -
Method Summary
Modifier and TypeMethodDescriptionprotected BitbucketRequestException
buildResponseException
(org.apache.http.client.methods.CloseableHttpResponse response, String errorMessage) void
close()
protected String
deleteRequest
(String path) protected String
doRequest
(org.apache.http.client.methods.HttpRequestBase request) protected String
doRequest
(org.apache.http.client.methods.HttpRequestBase request, boolean requireAuthentication) protected org.apache.http.client.methods.CloseableHttpResponse
executeMethod
(org.apache.http.HttpHost host, org.apache.http.client.methods.HttpRequestBase httpMethod) protected org.apache.http.client.methods.CloseableHttpResponse
executeMethod
(org.apache.http.HttpHost host, org.apache.http.client.methods.HttpRequestBase httpMethod, boolean requireAuthentication) protected BitbucketAuthenticator
protected abstract org.apache.http.impl.client.CloseableHttpClient
protected abstract org.apache.http.conn.HttpClientConnectionManager
protected abstract org.apache.http.HttpHost
getHost()
protected String
getRequest
(String path) protected InputStream
protected String
getResponseContent
(org.apache.http.client.methods.CloseableHttpResponse response) protected int
headRequestStatus
(String path) protected String
postRequest
(String path, String content) protected String
postRequest
(String path, List<? extends org.apache.http.NameValuePair> params) protected String
putRequest
(String path, String content) protected org.apache.http.impl.client.HttpClientBuilder
setupClientBuilder
(String host) protected String
truncateMiddle
(String value, int maxLength)
-
Field Details
-
logger
-
-
Constructor Details
-
AbstractBitbucketApi
-
-
Method Details
-
truncateMiddle
-
buildResponseException
protected BitbucketRequestException buildResponseException(org.apache.http.client.methods.CloseableHttpResponse response, String errorMessage) -
getResponseContent
protected String getResponseContent(org.apache.http.client.methods.CloseableHttpResponse response) throws IOException - Throws:
IOException
-
setupClientBuilder
-
getConnectionManager
@CheckForNull protected abstract org.apache.http.conn.HttpClientConnectionManager getConnectionManager() -
getHost
@NonNull protected abstract org.apache.http.HttpHost getHost() -
getClient
@NonNull protected abstract org.apache.http.impl.client.CloseableHttpClient getClient() -
executeMethod
protected org.apache.http.client.methods.CloseableHttpResponse executeMethod(org.apache.http.HttpHost host, org.apache.http.client.methods.HttpRequestBase httpMethod, boolean requireAuthentication) throws IOException - Throws:
IOException
-
executeMethod
protected org.apache.http.client.methods.CloseableHttpResponse executeMethod(org.apache.http.HttpHost host, org.apache.http.client.methods.HttpRequestBase httpMethod) throws IOException - Throws:
IOException
-
doRequest
protected String doRequest(org.apache.http.client.methods.HttpRequestBase request, boolean requireAuthentication) throws IOException - Throws:
IOException
-
doRequest
protected String doRequest(org.apache.http.client.methods.HttpRequestBase request) throws IOException - Throws:
IOException
-
getRequestAsInputStream
- Throws:
IOException
-
headRequestStatus
- Throws:
IOException
-
getRequest
- Throws:
IOException
-
postRequest
protected String postRequest(String path, List<? extends org.apache.http.NameValuePair> params) throws IOException - Throws:
IOException
-
postRequest
- Throws:
IOException
-
putRequest
- Throws:
IOException
-
deleteRequest
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-
getAuthenticator
-