Class AwsXmlPredicatedResponseHandler<OutputT>
java.lang.Object
software.amazon.awssdk.protocols.xml.internal.unmarshall.AwsXmlPredicatedResponseHandler<OutputT>
- Type Parameters:
OutputT
- Type of successful unmarshalled POJO.
- All Implemented Interfaces:
HttpResponseHandler<Response<OutputT>>
public class AwsXmlPredicatedResponseHandler<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 a predicate that the unmarshalled response can be tested against. Returns a wrapper
Response
object which
may contain either the unmarshalled success POJO, or the unmarshalled exception.-
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
ConstructorDescriptionAwsXmlPredicatedResponseHandler
(Function<SdkHttpFullResponse, SdkPojo> pojoSupplier, Function<AwsXmlUnmarshallingContext, OutputT> successResponseTransformer, Function<AwsXmlUnmarshallingContext, ? extends SdkException> errorResponseTransformer, Function<AwsXmlUnmarshallingContext, AwsXmlUnmarshallingContext> decorateContextWithError, boolean needsConnectionLeftOpen) Standard constructor -
Method Summary
Modifier and TypeMethodDescriptionhandle
(SdkHttpFullResponse httpResponse, ExecutionAttributes executionAttributes) Handle a responseMethods 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
-
AwsXmlPredicatedResponseHandler
public AwsXmlPredicatedResponseHandler(Function<SdkHttpFullResponse, SdkPojo> pojoSupplier, Function<AwsXmlUnmarshallingContext, OutputT> successResponseTransformer, Function<AwsXmlUnmarshallingContext, ? extends SdkException> errorResponseTransformer, Function<AwsXmlUnmarshallingContext, AwsXmlUnmarshallingContext> decorateContextWithError, boolean needsConnectionLeftOpen) Standard constructor- Parameters:
pojoSupplier
- A method that supplies an empty builder of the correct typesuccessResponseTransformer
- A function that can unmarshall a response object from parsed XMLerrorResponseTransformer
- A function that can unmarshall an exception object from parsed XMLdecorateContextWithError
- A function that determines if the response was an error or notneedsConnectionLeftOpen
- true if the underlying connection should not be closed once parsed
-
-
Method Details
-
handle
public Response<OutputT> handle(SdkHttpFullResponse httpResponse, ExecutionAttributes executionAttributes) Handle a response- Specified by:
handle
in interfaceHttpResponseHandler<OutputT>
- Parameters:
httpResponse
- The HTTP response objectexecutionAttributes
- The attributes attached to this particular execution.- Returns:
- A wrapped response object with the unmarshalled result in it.
-