1 /* 2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"). 5 * You may not use this file except in compliance with the License. 6 * A copy of the License is located at 7 * 8 * http://aws.amazon.com/apache2.0 9 * 10 * or in the "license" file accompanying this file. This file is distributed 11 * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 12 * express or implied. See the License for the specific language governing 13 * permissions and limitations under the License. 14 */ 15 16 package software.amazon.awssdk.core.client.handler; 17 18 import software.amazon.awssdk.annotations.SdkProtectedApi; 19 import software.amazon.awssdk.core.SdkRequest; 20 import software.amazon.awssdk.core.SdkResponse; 21 import software.amazon.awssdk.core.sync.ResponseTransformer; 22 import software.amazon.awssdk.utils.SdkAutoCloseable; 23 24 /** 25 * Client interface to invoke an API. 26 */ 27 @SdkProtectedApi 28 public interface SyncClientHandler extends SdkAutoCloseable { 29 30 /** 31 * Execute's a web service request. Handles marshalling and unmarshalling of data and making the 32 * underlying HTTP call(s). 33 * 34 * @param executionParams Parameters specific to this invocation of an API. 35 * @param <InputT> Input POJO type 36 * @param <OutputT> Output POJO type 37 * @return Unmarshalled output POJO type. 38 */ execute( ClientExecutionParams<InputT, OutputT> executionParams)39 <InputT extends SdkRequest, OutputT extends SdkResponse> OutputT execute( 40 ClientExecutionParams<InputT, OutputT> executionParams); 41 42 /** 43 * Execute's a streaming web service request. Handles marshalling and unmarshalling of data and making the 44 * underlying HTTP call(s). 45 * 46 * @param executionParams Parameters specific to this invocation of an API. 47 * @param responseTransformer Response handler for a streaming response. Receives unmarshalled POJO and input stream and 48 * returns a transformed result. 49 * @param <InputT> Input POJO type 50 * @param <OutputT> Output POJO type 51 * @param <ReturnT> Transformed result returned by responseTransformer. Returned by this method. 52 * @return Transformed result as returned by responseTransformer. 53 */ execute( ClientExecutionParams<InputT, OutputT> executionParams, ResponseTransformer<OutputT, ReturnT> responseTransformer)54 <InputT extends SdkRequest, OutputT extends SdkResponse, ReturnT> ReturnT execute( 55 ClientExecutionParams<InputT, OutputT> executionParams, 56 ResponseTransformer<OutputT, ReturnT> responseTransformer); 57 } 58