Class BaseAwsJsonProtocolFactory
java.lang.Object
software.amazon.awssdk.protocols.json.BaseAwsJsonProtocolFactory
- Direct Known Subclasses:
AwsCborProtocolFactory
,AwsJsonProtocolFactory
,SmithyRpcV2CborProtocolFactory
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OperationMetadataAttribute
<Boolean> Used by operations that do not serialize the input, e.g., when the input is not defined in the model.static final OperationMetadataAttribute
<Map<String, String>> Attribute for a protocol to configure extra headers for the operation. -
Method Summary
Modifier and TypeMethodDescriptioncreateErrorResponseHandler
(JsonOperationMetadata errorResponseMetadata) Deprecated.createErrorResponseHandler
(JsonOperationMetadata errorResponseMetadata, Function<String, Optional<ExceptionMetadata>> exceptionMetadataSupplier) createProtocolMarshaller
(OperationInfo operationInfo) final <T extends SdkPojo>
HttpResponseHandler<T> createResponseHandler
(JsonOperationMetadata operationMetadata, Function<SdkHttpFullResponse, SdkPojo> pojoSupplier) Creates a new response handler with the givenJsonOperationMetadata
and a supplier of the POJO response type.final <T extends SdkPojo>
HttpResponseHandler<T> createResponseHandler
(JsonOperationMetadata operationMetadata, Supplier<SdkPojo> pojoSupplier) Creates a new response handler with the givenJsonOperationMetadata
and a supplier of the POJO response type.final String
-
Field Details
-
GENERATES_BODY
Used by operations that do not serialize the input, e.g., when the input is not defined in the model. RPCv2 uses it. -
HTTP_EXTRA_HEADERS
Attribute for a protocol to configure extra headers for the operation.
-
-
Method Details
-
createResponseHandler
public final <T extends SdkPojo> HttpResponseHandler<T> createResponseHandler(JsonOperationMetadata operationMetadata, Supplier<SdkPojo> pojoSupplier) Creates a new response handler with the givenJsonOperationMetadata
and a supplier of the POJO response type.- Type Parameters:
T
- Type being unmarshalled.- Parameters:
operationMetadata
- Metadata about operation being unmarshalled.pojoSupplier
-Supplier
of the POJO response type.- Returns:
- HttpResponseHandler that will handle the HTTP response and unmarshall into a POJO.
-
createResponseHandler
public final <T extends SdkPojo> HttpResponseHandler<T> createResponseHandler(JsonOperationMetadata operationMetadata, Function<SdkHttpFullResponse, SdkPojo> pojoSupplier) Creates a new response handler with the givenJsonOperationMetadata
and a supplier of the POJO response type.- Type Parameters:
T
- Type being unmarshalled.- Parameters:
operationMetadata
- Metadata about operation being unmarshalled.pojoSupplier
-Supplier
of the POJO response type. Has access to the HTTP response, primarily for polymorphic deserialization as seen in event stream (i.e. unmarshalled event depends on ':event-type' header).- Returns:
- HttpResponseHandler that will handle the HTTP response and unmarshall into a POJO.
-
createErrorResponseHandler
@Deprecated public final HttpResponseHandler<AwsServiceException> createErrorResponseHandler(JsonOperationMetadata errorResponseMetadata) Deprecated.Users should favor usingcreateErrorResponseHandler(JsonOperationMetadata, Function)
, which allows the creation of an error unmarshaller that uses a mapping function to map from error code to the associatedExceptionMetadata
.Creates a response handler for handling a error response (non 2xx response). -
createErrorResponseHandler
public final HttpResponseHandler<AwsServiceException> createErrorResponseHandler(JsonOperationMetadata errorResponseMetadata, Function<String, Optional<ExceptionMetadata>> exceptionMetadataSupplier) -
getContentType
-
createProtocolMarshaller
public final ProtocolMarshaller<SdkHttpFullRequest> createProtocolMarshaller(OperationInfo operationInfo)
-
createErrorResponseHandler(JsonOperationMetadata, Function)
, which allows the creation of an error unmarshaller that uses a mapping function to map from error code to the associatedExceptionMetadata
.