Class CombinedResponseHandler<OutputT>
java.lang.Object
software.amazon.awssdk.core.internal.http.CombinedResponseHandler<OutputT>
- Type Parameters:
OutputT
- Type of successful unmarshalled POJO.
- All Implemented Interfaces:
HttpResponseHandler<Response<OutputT>>
public class CombinedResponseHandler<OutputT>
extends Object
implements HttpResponseHandler<Response<OutputT>>
Unmarshalls an HTTP response into either a successful response POJO, or into a (possibly modeled) exception based
on the status code of the HTTP response. Returns a wrapper
Response
object which may contain either the
unmarshalled success POJO, or the unmarshalled exception. Can be used with streaming or non-streaming requests.-
Field Summary
Fields inherited from interface software.amazon.awssdk.core.http.HttpResponseHandler
X_AMZ_ID_2_HEADER, X_AMZN_REQUEST_ID_HEADER, X_AMZN_REQUEST_ID_HEADER_ALTERNATE, X_AMZN_REQUEST_ID_HEADERS
-
Constructor Summary
ConstructorDescriptionCombinedResponseHandler
(HttpResponseHandler<OutputT> successResponseHandler, HttpResponseHandler<? extends SdkException> errorResponseHandler) -
Method Summary
Modifier and TypeMethodDescriptionhandle
(SdkHttpFullResponse httpResponse, ExecutionAttributes executionAttributes) Accepts an HTTP response object, and returns an object of type T.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.core.http.HttpResponseHandler
needsConnectionLeftOpen
-
Constructor Details
-
CombinedResponseHandler
public CombinedResponseHandler(HttpResponseHandler<OutputT> successResponseHandler, HttpResponseHandler<? extends SdkException> errorResponseHandler)
-
-
Method Details
-
handle
public Response<OutputT> handle(SdkHttpFullResponse httpResponse, ExecutionAttributes executionAttributes) throws Exception Description copied from interface:HttpResponseHandler
Accepts an HTTP response object, and returns an object of type T. Individual implementations may choose to handle the response however they need to, and return any type that they need to.- Specified by:
handle
in interfaceHttpResponseHandler<OutputT>
- Parameters:
httpResponse
- The HTTP response to handle, as received from an AWS service.executionAttributes
- The attributes attached to this particular execution.- Returns:
- An object of type T, as defined by individual implementations.
- Throws:
Exception
- If any problems are encountered handling the response.
-