Skip to content

Commit

Permalink
better naming
Browse files Browse the repository at this point in the history
  • Loading branch information
maciejwalkowiak committed Sep 23, 2024
1 parent 296fdaa commit 97c24c9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author Maciej Walkowiak
* @since 3.3.0
*/
public interface CommonAwsAsyncClientCustomizer {
public interface AwsAsyncClientCustomizer {
/**
* Callback to customize a {@link AwsAsyncClientBuilder} instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author Maciej Walkowiak
* @since 3.3.0
*/
public interface CommonAwsSyncClientCustomizer {
public interface AwsSyncClientCustomizer {
/**
* Callback to customize a {@link AwsSyncClientBuilder} instance.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
*/
package io.awspring.cloud.autoconfigure.core;

import io.awspring.cloud.autoconfigure.AwsAsyncClientCustomizer;
import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
import io.awspring.cloud.autoconfigure.AwsClientProperties;
import io.awspring.cloud.autoconfigure.CommonAwsAsyncClientCustomizer;
import io.awspring.cloud.autoconfigure.CommonAwsSyncClientCustomizer;
import io.awspring.cloud.autoconfigure.AwsSyncClientCustomizer;
import io.awspring.cloud.core.SpringCloudClientConfiguration;
import java.util.Optional;
import java.util.stream.Stream;
Expand Down Expand Up @@ -103,15 +103,15 @@ public AwsClientBuilderConfigurer(AwsCredentialsProvider credentialsProvider, Aw
public <T extends AwsClientBuilder<T, ?>> T configureSyncClient(T builder,
@Nullable AwsClientProperties clientProperties, @Nullable AwsConnectionDetails connectionDetails,
@Nullable Stream<? extends AwsClientCustomizer<T>> clientBuilderCustomizer,
@Nullable Stream<? extends CommonAwsSyncClientCustomizer> commonCustomizers) {
@Nullable Stream<? extends AwsSyncClientCustomizer> commonCustomizers) {
return configureSyncClient(builder, clientProperties, connectionDetails, null, clientBuilderCustomizer,
commonCustomizers);
}

public <T extends AwsClientBuilder<T, ?>> T configureAsyncClient(T builder,
@Nullable AwsClientProperties clientProperties, @Nullable AwsConnectionDetails connectionDetails,
@Nullable Stream<? extends AwsClientCustomizer<T>> clientBuilderCustomizer,
@Nullable Stream<? extends CommonAwsAsyncClientCustomizer> commonCustomizers) {
@Nullable Stream<? extends AwsAsyncClientCustomizer> commonCustomizers) {
return configureAsyncClient(builder, clientProperties, connectionDetails, null, clientBuilderCustomizer,
commonCustomizers);
}
Expand All @@ -133,7 +133,7 @@ public AwsClientBuilderConfigurer(AwsCredentialsProvider credentialsProvider, Aw
@Nullable AwsClientProperties clientProperties, @Nullable AwsConnectionDetails connectionDetails,
@Nullable io.awspring.cloud.autoconfigure.core.AwsClientCustomizer<T> customizer,
@Nullable Stream<? extends AwsClientCustomizer<T>> clientBuilderCustomizer,
@Nullable Stream<? extends CommonAwsSyncClientCustomizer> commonBuilderCustomizer) {
@Nullable Stream<? extends AwsSyncClientCustomizer> commonBuilderCustomizer) {
T result = configure(builder, clientProperties, connectionDetails, customizer);
if (commonBuilderCustomizer != null && builder instanceof AwsSyncClientBuilder<?, ?>) {
commonBuilderCustomizer.forEach(it -> it.customize((AwsSyncClientBuilder<?, ?>) result));
Expand All @@ -149,7 +149,7 @@ public AwsClientBuilderConfigurer(AwsCredentialsProvider credentialsProvider, Aw
@Nullable AwsClientProperties clientProperties, @Nullable AwsConnectionDetails connectionDetails,
@Nullable io.awspring.cloud.autoconfigure.core.AwsClientCustomizer<T> customizer,
@Nullable Stream<? extends AwsClientCustomizer<T>> clientBuilderCustomizer,
@Nullable Stream<? extends CommonAwsAsyncClientCustomizer> commonBuilderCustomizer) {
@Nullable Stream<? extends AwsAsyncClientCustomizer> commonBuilderCustomizer) {
T result = configure(builder, clientProperties, connectionDetails, customizer);
if (commonBuilderCustomizer != null && builder instanceof AwsAsyncClientBuilder<?, ?>) {
commonBuilderCustomizer.forEach(it -> it.customize((AwsAsyncClientBuilder<?, ?>) result));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/
package io.awspring.cloud.autoconfigure.dynamodb;

import io.awspring.cloud.autoconfigure.CommonAwsSyncClientCustomizer;
import io.awspring.cloud.autoconfigure.AwsSyncClientCustomizer;
import io.awspring.cloud.autoconfigure.core.AwsClientBuilderConfigurer;
import io.awspring.cloud.autoconfigure.core.AwsClientCustomizer;
import io.awspring.cloud.autoconfigure.core.AwsConnectionDetails;
Expand Down Expand Up @@ -116,11 +116,11 @@ static class StandardDynamoDbClient {
public DynamoDbClient dynamoDbClient(AwsClientBuilderConfigurer awsClientBuilderConfigurer,
ObjectProvider<AwsClientCustomizer<DynamoDbClientBuilder>> configurer,
ObjectProvider<AwsConnectionDetails> connectionDetails, DynamoDbProperties properties,
ObjectProvider<DynamoDbClientCustomizer> customizer,
ObjectProvider<CommonAwsSyncClientCustomizer> commonAwsClientCustomizers) {
ObjectProvider<DynamoDbClientCustomizer> dynamoDbClientCustomizers,
ObjectProvider<AwsSyncClientCustomizer> awsSyncClientCustomizers) {
return awsClientBuilderConfigurer.configureSyncClient(DynamoDbClient.builder(), properties,
connectionDetails.getIfAvailable(), configurer.getIfAvailable(), customizer.orderedStream(),
commonAwsClientCustomizers.orderedStream()).build();
connectionDetails.getIfAvailable(), configurer.getIfAvailable(),
dynamoDbClientCustomizers.orderedStream(), awsSyncClientCustomizers.orderedStream()).build();
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
package io.awspring.cloud.autoconfigure.dynamodb;

import io.awspring.cloud.autoconfigure.AwsClientCustomizer;
import software.amazon.awssdk.awscore.client.builder.AwsSyncClientBuilder;
import software.amazon.awssdk.services.dynamodb.DynamoDbClientBuilder;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import static org.assertj.core.api.Assertions.assertThat;

import io.awspring.cloud.autoconfigure.CommonAwsSyncClientCustomizer;
import io.awspring.cloud.autoconfigure.AwsSyncClientCustomizer;
import io.awspring.cloud.autoconfigure.ConfiguredAwsClient;
import io.awspring.cloud.autoconfigure.core.AwsAutoConfiguration;
import io.awspring.cloud.autoconfigure.core.CredentialsProviderAutoConfiguration;
Expand Down Expand Up @@ -90,7 +90,7 @@ DynamoDbClientCustomizer dynamoDbClientCustomizer2() {
}

@Bean
CommonAwsSyncClientCustomizer commonAwsSyncClientCustomizer() {
AwsSyncClientCustomizer commonAwsSyncClientCustomizer() {
return builder -> {
builder.httpClient(ApacheHttpClient.builder().connectionTimeout(Duration.ofMillis(1542)).build());
};
Expand Down

0 comments on commit 97c24c9

Please sign in to comment.