com.amazonaws.handlers
Class RequestHandler2

java.lang.Object
  extended by com.amazonaws.handlers.RequestHandler2
Direct Known Subclasses:
CredentialsRequestHandler

public abstract class RequestHandler2
extends java.lang.Object

Interface for addition request handling in clients. A request handler is executed on a request object before it is sent to the client runtime to be executed.

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 Summary
RequestHandler2()
           
 
Method Summary
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, java.lang.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).
abstract  void beforeRequest(Request<?> request)
          Runs any additional processing logic on the specified request (before it is executed by the client runtime).
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RequestHandler2

public RequestHandler2()
Method Detail

beforeRequest

public abstract void beforeRequest(Request<?> request)
Runs any additional processing logic on the specified request (before it is executed by the client runtime).

Parameters:
request - The low level request being processed.

afterResponse

public 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).

Parameters:
request - The low level request being processed.
response - The response generated from the specified request.

afterError

public abstract void afterError(Request<?> request,
                                Response<?> response,
                                java.lang.Exception e)
Runs any additional processing logic on a request after it has failed.

Parameters:
request - The request that generated an error.
response - the response or null if the failure occurred before the response is made available
e - The error that resulted from executing the request.

adapt

public 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.



Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.