AutoCloseable@ThreadSafe public class AmazonHttpClient extends Object implements AutoCloseable
| Modifier and Type | Class | Description |
|---|---|---|
static class |
AmazonHttpClient.Builder |
|
static interface |
AmazonHttpClient.RequestExecutionBuilder |
Interface to configure a request execution and execute the request.
|
| Modifier and Type | Field | Description |
|---|---|---|
static String |
HEADER_SDK_TRANSACTION_ID |
|
static String |
HEADER_USER_AGENT |
|
static org.apache.commons.logging.Log |
REQUEST_LOG |
Logger providing detailed information on requests/responses.
|
static int |
THROTTLED_RETRY_COST |
When throttled retries are enabled, each retry attempt will consume this much capacity.
|
| Modifier and Type | Method | Description |
|---|---|---|
static AmazonHttpClient.Builder |
builder() |
|
static void |
checkInterrupted() |
Check if the thread has been interrupted.
|
static void |
checkInterrupted(Response<?> response) |
Check if the thread has been interrupted.
|
void |
close() |
Shuts down this HTTP client object, releasing any resources that might be held open.
|
<T> T |
execute(Request<?> request,
HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
HttpResponseHandler<AmazonServiceException> errorResponseHandler,
ExecutionContext executionContext) |
Deprecated.
Use
requestExecutionBuilder() to configure and execute a HTTP request. |
ClientExecutionTimer |
getClientExecutionTimer() |
Package protected for unit-testing.
|
RequestMetricCollector |
getRequestMetricCollector() |
Returns the httpClientSettings client specific request metric collector; or null if there is
none.
|
AmazonHttpClient.RequestExecutionBuilder |
requestExecutionBuilder() |
public static final String HEADER_USER_AGENT
public static final String HEADER_SDK_TRANSACTION_ID
public static final org.apache.commons.logging.Log REQUEST_LOG
public static final int THROTTLED_RETRY_COST
public static AmazonHttpClient.Builder builder()
public void close()
throws Exception
close in interface AutoCloseableExceptionpublic ClientExecutionTimer getClientExecutionTimer()
public RequestMetricCollector getRequestMetricCollector()
public static void checkInterrupted()
throws InterruptedException
InterruptedException.
Long running tasks should be periodically checked if the current thread has been
interrupted and handle it appropriatelyInterruptedException - If thread has been interruptedpublic static void checkInterrupted(Response<?> response) throws InterruptedException
InterruptedException.
Long running tasks should be periodically checked if the current thread has been
interrupted and handle it appropriatelyresponse - Response to be closed before returning control to the caller to avoid
leaking the connection.InterruptedException - If thread has been interrupted@Deprecated public <T> T execute(Request<?> request, HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler, HttpResponseHandler<AmazonServiceException> errorResponseHandler, ExecutionContext executionContext)
requestExecutionBuilder() to configure and execute a HTTP request.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 AmazonHttpClient.RequestExecutionBuilder requestExecutionBuilder()
Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.