public class AmazonHttpClient
extends java.lang.Object
| Constructor and Description |
|---|
AmazonHttpClient(ClientConfiguration config)
Constructs a new AWS client using the specified client configuration
options (ex: max retry attempts, proxy settings, etc).
|
AmazonHttpClient(ClientConfiguration config,
HttpClient httpClient)
Constructs a new AWS client using the specified client configuration
options (ex: max retry attempts, proxy settings, etc), and request metric
collector.
|
AmazonHttpClient(ClientConfiguration config,
HttpClient httpClient,
RequestMetricCollector requestMetricCollector)
Deprecated.
|
AmazonHttpClient(ClientConfiguration config,
RequestMetricCollector requestMetricCollector)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
<T> Response<T> |
execute(Request<?> request,
HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
HttpResponseHandler<AmazonServiceException> errorResponseHandler,
ExecutionContext executionContext)
Executes the request and returns the result.
|
protected void |
finalize() |
RequestMetricCollector |
getRequestMetricCollector() |
ResponseMetadata |
getResponseMetadataForRequest(AmazonWebServiceRequest request)
Deprecated.
ResponseMetadata cache can hold up to 50 requests and
responses in memory and will cause memory issue. This method
now always returns null.
|
void |
shutdown()
Shuts down this HTTP client object, releasing any resources that might be
held open.
|
public AmazonHttpClient(ClientConfiguration config)
config - Configuration options specifying how this client will
communicate with AWS (ex: proxy settings, retry count, etc.).@Deprecated public AmazonHttpClient(ClientConfiguration config, RequestMetricCollector requestMetricCollector)
config - Configuration options specifying how this client will
communicate with AWS (ex: proxy settings, retry count, etc.).requestMetricCollector - client specific request metric collector,
which takes precedence over the one at the AWS SDK level; or
null if there is none.public AmazonHttpClient(ClientConfiguration config, HttpClient httpClient)
config - Configuration options specifying how this client will
communicate with AWS (ex: proxy settings, retry count, etc.).httpClient - client specific HttpClient@Deprecated public AmazonHttpClient(ClientConfiguration config, HttpClient httpClient, RequestMetricCollector requestMetricCollector)
config - Configuration options specifying how this client will
communicate with AWS (ex: proxy settings, retry count, etc.).httpClient - client specific HttpClientrequestMetricCollector - client specific request metric collector,
which takes precedence over the one at the AWS SDK level; or
null if there is none.@Deprecated public ResponseMetadata getResponseMetadataForRequest(AmazonWebServiceRequest request)
request - A previously executed AmazonWebServiceRequest object,
whose response metadata is desired.public <T> Response<T> execute(Request<?> request, HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler, HttpResponseHandler<AmazonServiceException> errorResponseHandler, ExecutionContext executionContext)
T - the response type.request - The AmazonWebServices request to send to the remote serverresponseHandler - A response handler to accept a successful response
from the remote servererrorResponseHandler - A response handler to accept an unsuccessful
response from the remote serverexecutionContext - Additional information about the context of this
web service callpublic void shutdown()
protected void finalize()
throws java.lang.Throwable
finalize in class java.lang.Objectjava.lang.Throwablepublic RequestMetricCollector getRequestMetricCollector()