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 wrapperResponseobject 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
Constructors Constructor Description AwsXmlPredicatedResponseHandler(Function<SdkHttpFullResponse,SdkPojo> pojoSupplier, Function<AwsXmlUnmarshallingContext,OutputT> successResponseTransformer, Function<AwsXmlUnmarshallingContext,? extends SdkException> errorResponseTransformer, Function<AwsXmlUnmarshallingContext,AwsXmlUnmarshallingContext> decorateContextWithError, boolean needsConnectionLeftOpen)Standard constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Response<OutputT>handle(SdkHttpFullResponse httpResponse, ExecutionAttributes executionAttributes)Handle a response-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.core.http.HttpResponseHandler
needsConnectionLeftOpen
-
-
-
-
Constructor Detail
-
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 Detail
-
handle
public Response<OutputT> handle(SdkHttpFullResponse httpResponse, ExecutionAttributes executionAttributes)
Handle a response- Specified by:
handlein 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.
-
-