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.Immutable; 19 import software.amazon.awssdk.annotations.SdkProtectedApi; 20 import software.amazon.awssdk.annotations.ThreadSafe; 21 import software.amazon.awssdk.core.SdkRequest; 22 import software.amazon.awssdk.core.SdkResponse; 23 import software.amazon.awssdk.core.client.config.SdkClientConfiguration; 24 import software.amazon.awssdk.core.client.config.SdkClientOptionValidation; 25 import software.amazon.awssdk.core.internal.handler.BaseSyncClientHandler; 26 import software.amazon.awssdk.core.internal.http.AmazonSyncHttpClient; 27 import software.amazon.awssdk.core.sync.ResponseTransformer; 28 29 /** 30 * Client handler for SDK clients. 31 */ 32 @ThreadSafe 33 @Immutable 34 @SdkProtectedApi 35 public class SdkSyncClientHandler extends BaseSyncClientHandler implements SyncClientHandler { 36 SdkSyncClientHandler(SdkClientConfiguration clientConfiguration)37 protected SdkSyncClientHandler(SdkClientConfiguration clientConfiguration) { 38 super(clientConfiguration, new AmazonSyncHttpClient(clientConfiguration)); 39 SdkClientOptionValidation.validateSyncClientOptions(clientConfiguration); 40 } 41 42 @Override execute( ClientExecutionParams<InputT, OutputT> executionParams)43 public <InputT extends SdkRequest, OutputT extends SdkResponse> OutputT execute( 44 ClientExecutionParams<InputT, OutputT> executionParams) { 45 return super.execute(executionParams); 46 } 47 48 @Override execute( ClientExecutionParams<InputT, OutputT> executionParams, ResponseTransformer<OutputT, ReturnT> responseTransformer)49 public <InputT extends SdkRequest, OutputT extends SdkResponse, ReturnT> ReturnT execute( 50 ClientExecutionParams<InputT, OutputT> executionParams, 51 ResponseTransformer<OutputT, ReturnT> responseTransformer) { 52 return super.execute(executionParams, responseTransformer); 53 } 54 55 } 56