com.amazonaws.http
Class AmazonHttpClient

java.lang.Object
  extended by com.amazonaws.http.AmazonHttpClient

@ThreadSafe
public class AmazonHttpClient
extends Object


Constructor Summary
AmazonHttpClient(ClientConfiguration config)
          Constructs a new AWS client using the specified client configuration options (ex: max retry attempts, proxy settings, etc).
AmazonHttpClient(ClientConfiguration config, RequestMetricCollector requestMetricCollector)
          Constructs a new AWS client using the specified client configuration options (ex: max retry attempts, proxy settings, etc), and request metric collector.
 
Method Summary
 void disableStrictHostnameVerification()
          Disables the default strict hostname verification in this client and instead uses a browser compatible hostname verification strategy (i.e.
<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()
          Returns the http client specific request metric collector; or null if there is none.
 ResponseMetadata getResponseMetadataForRequest(AmazonWebServiceRequest request)
          Returns additional response metadata for an executed request.
 void shutdown()
          Shuts down this HTTP client object, releasing any resources that might be held open.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AmazonHttpClient

public AmazonHttpClient(ClientConfiguration config)
Constructs a new AWS client using the specified client configuration options (ex: max retry attempts, proxy settings, etc).

Parameters:
config - Configuration options specifying how this client will communicate with AWS (ex: proxy settings, retry count, etc.).

AmazonHttpClient

public AmazonHttpClient(ClientConfiguration config,
                        RequestMetricCollector requestMetricCollector)
Constructs a new AWS client using the specified client configuration options (ex: max retry attempts, proxy settings, etc), and request metric collector.

Parameters:
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.
Method Detail

getResponseMetadataForRequest

public ResponseMetadata getResponseMetadataForRequest(AmazonWebServiceRequest request)
Returns additional response metadata for an executed request. Response metadata isn't considered part of the standard results returned by an operation, so it's accessed instead through this diagnostic interface. Response metadata is typically used for troubleshooting issues with AWS support staff when services aren't acting as expected.

Parameters:
request - A previously executed AmazonWebServiceRequest object, whose response metadata is desired.
Returns:
The response metadata for the specified request, otherwise null if there is no response metadata available for the request.

disableStrictHostnameVerification

public void disableStrictHostnameVerification()
Disables the default strict hostname verification in this client and instead uses a browser compatible hostname verification strategy (i.e. cert hostname wildcards are evaulated more liberally).


execute

public <T> Response<T> execute(Request<?> request,
                               HttpResponseHandler<AmazonWebServiceResponse<T>> responseHandler,
                               HttpResponseHandler<AmazonServiceException> errorResponseHandler,
                               ExecutionContext executionContext)
                    throws AmazonClientException,
                           AmazonServiceException
Executes the request and returns the result.

Parameters:
request - The AmazonWebServices request to send to the remote server
responseHandler - A response handler to accept a successful response from the remote server
errorResponseHandler - A response handler to accept an unsuccessful response from the remote server
executionContext - Additional information about the context of this web service call
Throws:
AmazonClientException
AmazonServiceException

shutdown

public void shutdown()
Shuts down this HTTP client object, releasing any resources that might be held open. This is an optional method, and callers are not expected to call it, but can if they want to explicitly release any open resources. Once a client has been shutdown, it cannot be used to make more requests.


finalize

protected void finalize()
                 throws Throwable
Overrides:
finalize in class Object
Throws:
Throwable

getRequestMetricCollector

public RequestMetricCollector getRequestMetricCollector()
Returns the http client specific request metric collector; or null if there is none.



Copyright © 2016. All rights reserved.