public abstract class RequestHandler2 extends Object
This interface deprecates RequestHandler
by providing access to not
only the AWS response, but also the associated http response via
Response
.
Note TimingInfo
is accessible via
Request.getAWSRequestMetrics()
and hence is omitted from the
interface to reduce duplication by design.
Constructor and Description |
---|
RequestHandler2() |
Modifier and Type | Method and Description |
---|---|
static RequestHandler2 |
adapt(RequestHandler old)
Returns an instance of request handler adapted to the
RequestHandler2 interface from the given request handler
implementing the deprecated RequestHandler interface. |
abstract void |
afterError(Request<?> request,
Response<?> response,
Exception e)
Runs any additional processing logic on a request after it has failed.
|
abstract void |
afterResponse(Request<?> request,
Response<?> response)
Runs any additional processing logic on the specified request (after is
has been executed by the client runtime).
|
AmazonWebServiceRequest |
beforeMarshalling(AmazonWebServiceRequest request)
Runs any additional processing logic on the specified request object
before it is marshaled into an HTTP request.
|
abstract void |
beforeRequest(Request<?> request)
Runs any additional processing logic on the specified request (before it
is executed by the client runtime).
|
public AmazonWebServiceRequest beforeMarshalling(AmazonWebServiceRequest request)
If you're going to modify the request, make sure to clone it first, modify the clone, and return it from this method. Otherwise your changes will leak out to the user, who might reuse the request object without realizing that it was modified as part of sending it the first time.
request
- the request passed in by the userpublic abstract void beforeRequest(Request<?> request)
request
- The low level request being processed.public abstract void afterResponse(Request<?> request, Response<?> response)
request
- The low level request being processed.response
- The response generated from the specified request.public abstract void afterError(Request<?> request, Response<?> response, Exception e)
request
- The request that generated an error.response
- the response or null if the failure occurred before the
response is made availablee
- The error that resulted from executing the request.public static RequestHandler2 adapt(RequestHandler old)
RequestHandler2
interface from the given request handler
implementing the deprecated RequestHandler
interface.Copyright © 2015. All rights reserved.