Class AwsClientBuilderUtil
java.lang.Object
org.apache.camel.component.aws.common.AwsClientBuilderUtil
Utility class for building AWS SDK clients with common configuration.
This class eliminates code duplication across all AWS Camel components by providing a centralized way to configure AWS clients with credentials, proxy, region, endpoint, and other common settings.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkAsyncClientBuilder<B, C>, C extends software.amazon.awssdk.core.SdkClient>
CbuildAsyncClient(AwsCommonConfiguration config, Supplier<B> builderSupplier) Build an AWS async client with the given configuration, without service-specific configuration.static <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkAsyncClientBuilder<B, C>, C extends software.amazon.awssdk.core.SdkClient>
CbuildAsyncClient(AwsCommonConfiguration config, Supplier<B> builderSupplier, Consumer<B> serviceSpecificConfig) Build an AWS async client with the given configuration.static <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkSyncClientBuilder<B, C>, C extends software.amazon.awssdk.core.SdkClient>
CbuildClient(AwsCommonConfiguration config, Supplier<B> builderSupplier) Build an AWS client with the given configuration, without service-specific configuration.static <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkSyncClientBuilder<B, C>, C extends software.amazon.awssdk.core.SdkClient>
CbuildClient(AwsCommonConfiguration config, Supplier<B> builderSupplier, Consumer<B> serviceSpecificConfig) Build an AWS client with the given configuration.
-
Method Details
-
buildClient
public static <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkSyncClientBuilder<B, C buildClientC>, C extends software.amazon.awssdk.core.SdkClient> (AwsCommonConfiguration config, Supplier<B> builderSupplier, Consumer<B> serviceSpecificConfig) Build an AWS client with the given configuration.- Type Parameters:
B- The builder type (must extend both AwsClientBuilder and SdkSyncClientBuilder)C- The client type- Parameters:
config- The common AWS configurationbuilderSupplier- Supplier for the service-specific client builder (e.g., S3Client::builder)serviceSpecificConfig- Optional consumer for service-specific configuration (e.g., S3's forcePathStyle)- Returns:
- The configured AWS client
-
buildClient
public static <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkSyncClientBuilder<B, C buildClientC>, C extends software.amazon.awssdk.core.SdkClient> (AwsCommonConfiguration config, Supplier<B> builderSupplier) Build an AWS client with the given configuration, without service-specific configuration.- Type Parameters:
B- The builder typeC- The client type- Parameters:
config- The common AWS configurationbuilderSupplier- Supplier for the service-specific client builder- Returns:
- The configured AWS client
-
buildAsyncClient
public static <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkAsyncClientBuilder<B, C buildAsyncClientC>, C extends software.amazon.awssdk.core.SdkClient> (AwsCommonConfiguration config, Supplier<B> builderSupplier, Consumer<B> serviceSpecificConfig) Build an AWS async client with the given configuration.- Type Parameters:
B- The builder type (must extend both AwsClientBuilder and SdkAsyncClientBuilder)C- The client type- Parameters:
config- The common AWS configurationbuilderSupplier- Supplier for the service-specific async client builder (e.g., KinesisAsyncClient::builder)serviceSpecificConfig- Optional consumer for service-specific configuration- Returns:
- The configured AWS async client
-
buildAsyncClient
public static <B extends software.amazon.awssdk.awscore.client.builder.AwsClientBuilder<B,C> & software.amazon.awssdk.core.client.builder.SdkAsyncClientBuilder<B, C buildAsyncClientC>, C extends software.amazon.awssdk.core.SdkClient> (AwsCommonConfiguration config, Supplier<B> builderSupplier) Build an AWS async client with the given configuration, without service-specific configuration.- Type Parameters:
B- The builder typeC- The client type- Parameters:
config- The common AWS configurationbuilderSupplier- Supplier for the service-specific async client builder- Returns:
- The configured AWS async client
-