public static interface ClientOverrideConfiguration.Builder extends CopyableBuilder<ClientOverrideConfiguration.Builder,ClientOverrideConfiguration>
ClientOverrideConfiguration
.
All implementations of this interface are mutable and not thread safe.
Modifier and Type | Method and Description |
---|---|
ClientOverrideConfiguration.Builder |
addExecutionInterceptor(ExecutionInterceptor executionInterceptor)
Add an execution interceptor that will have access to read and modify the request and response objects as they are
processed by the SDK.
|
ClientOverrideConfiguration.Builder |
addMetricPublisher(MetricPublisher metricPublisher)
Add a metric publisher to the existing list of previously set publishers to be used for publishing metrics
for this client.
|
AttributeMap |
advancedOptions() |
ClientOverrideConfiguration.Builder |
advancedOptions(Map<SdkAdvancedClientOption<?>,?> advancedOptions)
Configure the map of advanced override options.
|
Duration |
apiCallAttemptTimeout() |
ClientOverrideConfiguration.Builder |
apiCallAttemptTimeout(Duration apiCallAttemptTimeout)
Configure the amount of time to wait for the http request to complete before giving up and timing out.
|
Duration |
apiCallTimeout() |
ClientOverrideConfiguration.Builder |
apiCallTimeout(Duration apiCallTimeout)
Configure the amount of time to allow the client to complete the execution of an API call.
|
ProfileFile |
defaultProfileFile() |
ClientOverrideConfiguration.Builder |
defaultProfileFile(ProfileFile defaultProfileFile)
Configure the profile file that should be used by default for all profile-based configuration in the SDK client.
|
String |
defaultProfileName() |
ClientOverrideConfiguration.Builder |
defaultProfileName(String defaultProfileName)
Configure the profile name that should be used by default for all profile-based configuration in the SDK client.
|
ExecutionAttributes |
executionAttributes() |
ClientOverrideConfiguration.Builder |
executionAttributes(ExecutionAttributes executionAttributes)
Sets the additional execution attributes collection for this client.
|
List<ExecutionInterceptor> |
executionInterceptors() |
ClientOverrideConfiguration.Builder |
executionInterceptors(List<ExecutionInterceptor> executionInterceptors)
Configure a list of execution interceptors that will have access to read and modify the request and response objcets as
they are processed by the SDK.
|
Map<String,List<String>> |
headers() |
ClientOverrideConfiguration.Builder |
headers(Map<String,List<String>> headers)
Configure headers to be set on the HTTP request.
|
List<MetricPublisher> |
metricPublishers() |
ClientOverrideConfiguration.Builder |
metricPublishers(List<MetricPublisher> metricPublishers)
Set the Metric publishers to be use to publish metrics for this client.
|
<T> ClientOverrideConfiguration.Builder |
putAdvancedOption(SdkAdvancedClientOption<T> option,
T value)
Configure an advanced override option.
|
<T> ClientOverrideConfiguration.Builder |
putExecutionAttribute(ExecutionAttribute<T> attribute,
T value)
Put an execution attribute into to the existing collection of execution attributes.
|
ClientOverrideConfiguration.Builder |
putHeader(String name,
List<String> values)
Add a single header with multiple values to be set on the HTTP request.
|
default ClientOverrideConfiguration.Builder |
putHeader(String name,
String value)
Add a single header to be set on the HTTP request.
|
RetryPolicy |
retryPolicy() |
default ClientOverrideConfiguration.Builder |
retryPolicy(Consumer<RetryPolicy.Builder> retryPolicy)
Configure the retry policy the should be used when handling failure cases.
|
default ClientOverrideConfiguration.Builder |
retryPolicy(RetryMode retryMode)
Configure the retry mode used to determine the retry policy that is used when handling failure cases.
|
ClientOverrideConfiguration.Builder |
retryPolicy(RetryPolicy retryPolicy)
Configure the retry policy that should be used when handling failure cases.
|
copy
applyMutation, build
default ClientOverrideConfiguration.Builder putHeader(String name, String value)
This overrides any values for the given header set on the request by default by the SDK.
This overrides any values already configured with this header name in the builder.
name
- The name of the header.value
- The value of the header.ClientOverrideConfiguration.Builder putHeader(String name, List<String> values)
This overrides any values for the given header set on the request by default by the SDK.
This overrides any values already configured with this header name in the builder.
name
- The name of the header.values
- The values of the header.ClientOverrideConfiguration.Builder headers(Map<String,List<String>> headers)
This overrides any values for the given headers set on the request by default by the SDK.
This overrides any values currently configured in the builder.
headers
- The set of additional headers.ClientOverrideConfiguration.Builder retryPolicy(RetryPolicy retryPolicy)
default ClientOverrideConfiguration.Builder retryPolicy(Consumer<RetryPolicy.Builder> retryPolicy)
default ClientOverrideConfiguration.Builder retryPolicy(RetryMode retryMode)
retryPolicy(RetryPolicy.forRetryMode(retryMode))
, and overrides any configured retry policy on
this builder.RetryPolicy retryPolicy()
ClientOverrideConfiguration.Builder executionInterceptors(List<ExecutionInterceptor> executionInterceptors)
addExecutionInterceptor(ExecutionInterceptor)
.
The provided interceptors are executed in the order they are configured and are always later in the order than the ones
automatically added by the SDK. See ExecutionInterceptor
for a more detailed explanation of interceptor order.
This overrides any values currently configured in the builder.
ClientOverrideConfiguration.Builder addExecutionInterceptor(ExecutionInterceptor executionInterceptor)
Interceptors added using this method are executed in the order they are configured and are always later in the order
than the ones automatically added by the SDK. See ExecutionInterceptor
for a more detailed explanation of
interceptor order.
List<ExecutionInterceptor> executionInterceptors()
<T> ClientOverrideConfiguration.Builder putAdvancedOption(SdkAdvancedClientOption<T> option, T value)
T
- The type of the option.option
- The option to configure.value
- The value of the option.ClientOverrideConfiguration.Builder advancedOptions(Map<SdkAdvancedClientOption<?>,?> advancedOptions)
AttributeMap advancedOptions()
ClientOverrideConfiguration.Builder apiCallTimeout(Duration apiCallTimeout)
The api call timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the client execution timeout feature should not be used when absolute precision is needed.
For synchronous streaming operations, implementations of ResponseTransformer
must handle interrupt
properly to allow the the SDK to timeout the request in a timely manner.
This may be used together with apiCallAttemptTimeout()
to enforce both a timeout on each individual HTTP
request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time).
You can also configure it on a per-request basis via
RequestOverrideConfiguration.Builder#apiCallTimeout(Duration)
.
Note that request-level timeout takes precedence.
Duration apiCallTimeout()
ClientOverrideConfiguration.Builder apiCallAttemptTimeout(Duration apiCallAttemptTimeout)
The request timeout feature doesn't have strict guarantees on how quickly a request is aborted when the timeout is breached. The typical case aborts the request within a few milliseconds but there may occasionally be requests that don't get aborted until several seconds after the timer has been breached. Because of this, the api call attempt timeout feature should not be used when absolute precision is needed.
For synchronous streaming operations, the process in ResponseTransformer
is not timed and will not
be aborted.
This may be used together with apiCallTimeout()
to enforce both a timeout on each individual HTTP
request (i.e. each retry) and the total time spent on all requests across retries (i.e. the 'api call' time).
You can also configure it on a per-request basis via
RequestOverrideConfiguration.Builder#apiCallAttemptTimeout(Duration)
.
Note that request-level timeout takes precedence.
Duration apiCallAttemptTimeout()
ClientOverrideConfiguration.Builder defaultProfileFile(ProfileFile defaultProfileFile)
This is equivalent to setting the ProfileFileSystemSetting.AWS_CONFIG_FILE
and
ProfileFileSystemSetting.AWS_SHARED_CREDENTIALS_FILE
environment variables or system properties.
Like the system settings, this value is only used when determining default values. For example, directly configuring the retry policy, credentials provider or region will mean that the configured values will be used instead of those from the profile file.
Like the --profile
setting in the CLI, profile-based configuration loaded from this profile file has lower
priority than more specific environment variables, like the AWS_REGION
environment variable.
If this is not set, the ProfileFile.defaultProfileFile()
is used.
defaultProfileName(String)
ProfileFile defaultProfileFile()
ClientOverrideConfiguration.Builder defaultProfileName(String defaultProfileName)
This is equivalent to setting the ProfileFileSystemSetting.AWS_PROFILE
environment variable or system
property.
Like the system setting, this value is only used when determining default values. For example, directly configuring the retry policy, credentials provider or region will mean that the configured values will be used instead of those from this profile.
If this is not set, the ProfileFileSystemSetting.AWS_PROFILE
(or "default"
) is used.
defaultProfileFile(ProfileFile)
String defaultProfileName()
ClientOverrideConfiguration.Builder metricPublishers(List<MetricPublisher> metricPublishers)
metricPublishers
- The metric publishers.ClientOverrideConfiguration.Builder addMetricPublisher(MetricPublisher metricPublisher)
metricPublisher
- The metric publisher to add.List<MetricPublisher> metricPublishers()
ClientOverrideConfiguration.Builder executionAttributes(ExecutionAttributes executionAttributes)
executionAttributes
- Execution attributes map for this client.<T> ClientOverrideConfiguration.Builder putExecutionAttribute(ExecutionAttribute<T> attribute, T value)
attribute
- The execution attribute objectvalue
- The value of the execution attribute.ExecutionAttributes executionAttributes()
Copyright © 2023. All rights reserved.