@@ -64,14 +64,14 @@ protected final String serviceName() {
64
64
@ Override
65
65
protected final SdkClientConfiguration mergeServiceDefaults (SdkClientConfiguration config ) {
66
66
return config .merge (c -> c
67
- .option (SdkClientOption .ENDPOINT_PROVIDER , defaultEndpointProvider ())
68
- .option (SdkClientOption .AUTH_SCHEME_PROVIDER , defaultAuthSchemeProvider ())
69
- .option (SdkClientOption .AUTH_SCHEMES , authSchemes ())
70
- .option (SdkClientOption .CRC32_FROM_COMPRESSED_DATA_ENABLED , false )
71
- .option (SdkClientOption .SERVICE_CONFIGURATION , ServiceConfiguration .builder ().build ())
72
- .lazyOption (AwsClientOption .TOKEN_PROVIDER ,
67
+ .option (SdkClientOption .ENDPOINT_PROVIDER , defaultEndpointProvider ())
68
+ .option (SdkClientOption .AUTH_SCHEME_PROVIDER , defaultAuthSchemeProvider ())
69
+ .option (SdkClientOption .AUTH_SCHEMES , authSchemes ())
70
+ .option (SdkClientOption .CRC32_FROM_COMPRESSED_DATA_ENABLED , false )
71
+ .option (SdkClientOption .SERVICE_CONFIGURATION , ServiceConfiguration .builder ().build ())
72
+ .lazyOption (AwsClientOption .TOKEN_PROVIDER ,
73
73
p -> TokenUtils .toSdkTokenProvider (p .get (AwsClientOption .TOKEN_IDENTITY_PROVIDER )))
74
- .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER , defaultTokenProvider ()));
74
+ .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER , defaultTokenProvider ()));
75
75
}
76
76
77
77
@ Override
@@ -82,64 +82,64 @@ protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientCon
82
82
endpointInterceptors .add (new JsonRequestSetEndpointInterceptor ());
83
83
ClasspathInterceptorChainFactory interceptorFactory = new ClasspathInterceptorChainFactory ();
84
84
List <ExecutionInterceptor > interceptors = interceptorFactory
85
- .getInterceptors ("software/amazon/awssdk/services/json/execution.interceptors" );
85
+ .getInterceptors ("software/amazon/awssdk/services/json/execution.interceptors" );
86
86
List <ExecutionInterceptor > additionalInterceptors = new ArrayList <>();
87
87
interceptors = CollectionUtils .mergeLists (endpointInterceptors , interceptors );
88
88
interceptors = CollectionUtils .mergeLists (interceptors , additionalInterceptors );
89
89
interceptors = CollectionUtils .mergeLists (interceptors , config .option (SdkClientOption .EXECUTION_INTERCEPTORS ));
90
90
ServiceConfiguration .Builder serviceConfigBuilder = ((ServiceConfiguration ) config
91
- .option (SdkClientOption .SERVICE_CONFIGURATION )).toBuilder ();
91
+ .option (SdkClientOption .SERVICE_CONFIGURATION )).toBuilder ();
92
92
serviceConfigBuilder .profileFile (serviceConfigBuilder .profileFileSupplier () != null ? serviceConfigBuilder
93
- .profileFileSupplier () : config .option (SdkClientOption .PROFILE_FILE_SUPPLIER ));
93
+ .profileFileSupplier () : config .option (SdkClientOption .PROFILE_FILE_SUPPLIER ));
94
94
serviceConfigBuilder .profileName (serviceConfigBuilder .profileName () != null ? serviceConfigBuilder .profileName () : config
95
- .option (SdkClientOption .PROFILE_NAME ));
95
+ .option (SdkClientOption .PROFILE_NAME ));
96
96
if (serviceConfigBuilder .dualstackEnabled () != null ) {
97
97
Validate .validState (
98
- config .option (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED ) == null ,
99
- "Dualstack has been configured on both ServiceConfiguration and the client/global level. Please limit dualstack configuration to one location." );
98
+ config .option (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED ) == null ,
99
+ "Dualstack has been configured on both ServiceConfiguration and the client/global level. Please limit dualstack configuration to one location." );
100
100
} else {
101
101
serviceConfigBuilder .dualstackEnabled (config .option (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED ));
102
102
}
103
103
if (serviceConfigBuilder .fipsModeEnabled () != null ) {
104
104
Validate .validState (
105
- config .option (AwsClientOption .FIPS_ENDPOINT_ENABLED ) == null ,
106
- "Fips has been configured on both ServiceConfiguration and the client/global level. Please limit fips configuration to one location." );
105
+ config .option (AwsClientOption .FIPS_ENDPOINT_ENABLED ) == null ,
106
+ "Fips has been configured on both ServiceConfiguration and the client/global level. Please limit fips configuration to one location." );
107
107
} else {
108
108
serviceConfigBuilder .fipsModeEnabled (config .option (AwsClientOption .FIPS_ENDPOINT_ENABLED ));
109
109
}
110
110
if (serviceConfigBuilder .useArnRegionEnabled () != null ) {
111
111
Validate .validState (
112
- clientContextParams .get (JsonClientContextParams .USE_ARN_REGION ) == null ,
113
- "UseArnRegion has been configured on both ServiceConfiguration and the client/global level. Please limit UseArnRegion configuration to one location." );
112
+ clientContextParams .get (JsonClientContextParams .USE_ARN_REGION ) == null ,
113
+ "UseArnRegion has been configured on both ServiceConfiguration and the client/global level. Please limit UseArnRegion configuration to one location." );
114
114
} else {
115
115
serviceConfigBuilder .useArnRegionEnabled (clientContextParams .get (JsonClientContextParams .USE_ARN_REGION ));
116
116
}
117
117
if (serviceConfigBuilder .multiRegionEnabled () != null ) {
118
118
Validate .validState (
119
- clientContextParams .get (JsonClientContextParams .DISABLE_MULTI_REGION_ACCESS_POINTS ) == null ,
120
- "DisableMultiRegionAccessPoints has been configured on both ServiceConfiguration and the client/global level. Please limit DisableMultiRegionAccessPoints configuration to one location." );
119
+ clientContextParams .get (JsonClientContextParams .DISABLE_MULTI_REGION_ACCESS_POINTS ) == null ,
120
+ "DisableMultiRegionAccessPoints has been configured on both ServiceConfiguration and the client/global level. Please limit DisableMultiRegionAccessPoints configuration to one location." );
121
121
} else if (clientContextParams .get (JsonClientContextParams .DISABLE_MULTI_REGION_ACCESS_POINTS ) != null ) {
122
122
serviceConfigBuilder .multiRegionEnabled (!clientContextParams
123
- .get (JsonClientContextParams .DISABLE_MULTI_REGION_ACCESS_POINTS ));
123
+ .get (JsonClientContextParams .DISABLE_MULTI_REGION_ACCESS_POINTS ));
124
124
}
125
125
if (serviceConfigBuilder .pathStyleAccessEnabled () != null ) {
126
126
Validate .validState (
127
- clientContextParams .get (JsonClientContextParams .FORCE_PATH_STYLE ) == null ,
128
- "ForcePathStyle has been configured on both ServiceConfiguration and the client/global level. Please limit ForcePathStyle configuration to one location." );
127
+ clientContextParams .get (JsonClientContextParams .FORCE_PATH_STYLE ) == null ,
128
+ "ForcePathStyle has been configured on both ServiceConfiguration and the client/global level. Please limit ForcePathStyle configuration to one location." );
129
129
} else {
130
130
serviceConfigBuilder .pathStyleAccessEnabled (clientContextParams .get (JsonClientContextParams .FORCE_PATH_STYLE ));
131
131
}
132
132
if (serviceConfigBuilder .accelerateModeEnabled () != null ) {
133
133
Validate .validState (
134
- clientContextParams .get (JsonClientContextParams .ACCELERATE ) == null ,
135
- "Accelerate has been configured on both ServiceConfiguration and the client/global level. Please limit Accelerate configuration to one location." );
134
+ clientContextParams .get (JsonClientContextParams .ACCELERATE ) == null ,
135
+ "Accelerate has been configured on both ServiceConfiguration and the client/global level. Please limit Accelerate configuration to one location." );
136
136
} else {
137
137
serviceConfigBuilder .accelerateModeEnabled (clientContextParams .get (JsonClientContextParams .ACCELERATE ));
138
138
}
139
139
ServiceConfiguration finalServiceConfig = serviceConfigBuilder .build ();
140
140
clientContextParams .put (JsonClientContextParams .USE_ARN_REGION , finalServiceConfig .useArnRegionEnabled ());
141
141
clientContextParams .put (JsonClientContextParams .DISABLE_MULTI_REGION_ACCESS_POINTS ,
142
- !finalServiceConfig .multiRegionEnabled ());
142
+ !finalServiceConfig .multiRegionEnabled ());
143
143
clientContextParams .put (JsonClientContextParams .FORCE_PATH_STYLE , finalServiceConfig .pathStyleAccessEnabled ());
144
144
clientContextParams .put (JsonClientContextParams .ACCELERATE , finalServiceConfig .accelerateModeEnabled ());
145
145
SdkClientConfiguration .Builder builder = config .toBuilder ();
@@ -156,7 +156,7 @@ protected final SdkClientConfiguration finalizeServiceConfiguration(SdkClientCon
156
156
return result .build ();
157
157
});
158
158
builder .option (SdkClientOption .EXECUTION_INTERCEPTORS , interceptors );
159
- builder .option (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED , finalServiceConfig .dualstackEnabled ());
159
+ builder .option (AwsClientOption .DUALSTACK_ENDPOINT_ENABLED , serviceConfigBuilder .dualstackEnabled ());
160
160
builder .option (AwsClientOption .FIPS_ENDPOINT_ENABLED , finalServiceConfig .fipsModeEnabled ());
161
161
builder .option (SdkClientOption .RETRY_STRATEGY , MyServiceRetryStrategy .resolveRetryStrategy (config ));
162
162
if (builder .option (SdkClientOption .RETRY_STRATEGY ) == null ) {
@@ -270,6 +270,6 @@ private List<SdkPlugin> internalPlugins(SdkClientConfiguration config) {
270
270
271
271
protected static void validateClientOptions (SdkClientConfiguration c ) {
272
272
Validate .notNull (c .option (AwsClientOption .TOKEN_IDENTITY_PROVIDER ),
273
- "The 'tokenProvider' must be configured in the client builder." );
273
+ "The 'tokenProvider' must be configured in the client builder." );
274
274
}
275
275
}
0 commit comments