Interface ClientOverrideConfiguration.Builder
-
- All Superinterfaces:
Buildable
,CopyableBuilder<ClientOverrideConfiguration.Builder,ClientOverrideConfiguration>
,SdkBuilder<ClientOverrideConfiguration.Builder,ClientOverrideConfiguration>
- Enclosing class:
- ClientOverrideConfiguration
public static interface ClientOverrideConfiguration.Builder extends CopyableBuilder<ClientOverrideConfiguration.Builder,ClientOverrideConfiguration>
A builder forClientOverrideConfiguration
.All implementations of this interface are mutable and not thread safe.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method 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.CompressionConfiguration
compressionConfiguration()
default ClientOverrideConfiguration.Builder
compressionConfiguration(Consumer<CompressionConfiguration.Builder> compressionConfiguration)
Sets theCompressionConfiguration
for this client.ClientOverrideConfiguration.Builder
compressionConfiguration(CompressionConfiguration compressionConfiguration)
Sets theCompressionConfiguration
for this client.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.Supplier<ProfileFile>
defaultProfileFileSupplier()
ClientOverrideConfiguration.Builder
defaultProfileFileSupplier(Supplier<ProfileFile> defaultProfileFile)
Configure aProfileFileSupplier
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.default ClientOverrideConfiguration.Builder
putHeader(String name, String value)
Add a single header to be set on the HTTP request.ClientOverrideConfiguration.Builder
putHeader(String name, List<String> values)
Add a single header with multiple values 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.ScheduledExecutorService
scheduledExecutorService()
ClientOverrideConfiguration.Builder
scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Configure the scheduled executor service that should be used for scheduling tasks such as async retry attempts and timeout task.-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
-
-
-
Method Detail
-
putHeader
default ClientOverrideConfiguration.Builder putHeader(String name, String value)
Add a single header to be set on the HTTP request.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.
- Parameters:
name
- The name of the header.value
- The value of the header.- Returns:
- This object for method chaining.
-
putHeader
ClientOverrideConfiguration.Builder putHeader(String name, List<String> values)
Add a single header with multiple values to be set on the HTTP request.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.
- Parameters:
name
- The name of the header.values
- The values of the header.- Returns:
- This object for method chaining.
-
headers
ClientOverrideConfiguration.Builder headers(Map<String,List<String>> headers)
Configure headers to be set on the HTTP request.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.
- Parameters:
headers
- The set of additional headers.- Returns:
- This object for method chaining.
-
retryPolicy
ClientOverrideConfiguration.Builder retryPolicy(RetryPolicy retryPolicy)
Configure the retry policy that should be used when handling failure cases.
-
retryPolicy
default ClientOverrideConfiguration.Builder retryPolicy(Consumer<RetryPolicy.Builder> retryPolicy)
Configure the retry policy the should be used when handling failure cases.
-
retryPolicy
default ClientOverrideConfiguration.Builder retryPolicy(RetryMode retryMode)
Configure the retry mode used to determine the retry policy that is used when handling failure cases. This is shorthand forretryPolicy(RetryPolicy.forRetryMode(retryMode))
, and overrides any configured retry policy on this builder.
-
retryPolicy
RetryPolicy retryPolicy()
-
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. These will replace any interceptors configured previously with this method oraddExecutionInterceptor(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.
-
addExecutionInterceptor
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.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.
-
executionInterceptors
List<ExecutionInterceptor> executionInterceptors()
-
scheduledExecutorService
ClientOverrideConfiguration.Builder scheduledExecutorService(ScheduledExecutorService scheduledExecutorService)
Configure the scheduled executor service that should be used for scheduling tasks such as async retry attempts and timeout task.The SDK will not automatically close the executor when the client is closed. It is the responsibility of the user to manually close the executor once all clients utilizing it have been closed.
When modifying this option from an
SdkPlugin
, it is strongly recommended to decorate thescheduledExecutorService()
. If you will be replacing it entirely, you MUST shut it down to prevent the resources being leaked.
-
scheduledExecutorService
ScheduledExecutorService scheduledExecutorService()
-
putAdvancedOption
<T> ClientOverrideConfiguration.Builder putAdvancedOption(SdkAdvancedClientOption<T> option, T value)
Configure an advanced override option. These values are used very rarely, and the majority of SDK customers can ignore them.- Type Parameters:
T
- The type of the option.- Parameters:
option
- The option to configure.value
- The value of the option.
-
advancedOptions
ClientOverrideConfiguration.Builder advancedOptions(Map<SdkAdvancedClientOption<?>,?> advancedOptions)
Configure the map of advanced override options. This will override all values currently configured. The values in the map must match the key type of the map, or a runtime exception will be raised.
-
advancedOptions
AttributeMap advancedOptions()
-
apiCallTimeout
ClientOverrideConfiguration.Builder apiCallTimeout(Duration apiCallTimeout)
Configure the amount of time to allow the client to complete the execution of an API call. This timeout covers the entire client execution except for marshalling. This includes request handler execution, all HTTP requests including retries, unmarshalling, etc. This value should always be positive, if present.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.
-
apiCallTimeout
Duration apiCallTimeout()
-
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. This value should always be positive, if present.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.
-
apiCallAttemptTimeout
Duration apiCallAttemptTimeout()
-
defaultProfileFileSupplier
ClientOverrideConfiguration.Builder defaultProfileFileSupplier(Supplier<ProfileFile> defaultProfileFile)
Configure aProfileFileSupplier
that should be used by default for all profile-based configuration in the SDK client.This is equivalent to setting
defaultProfileFile(ProfileFile)
, except the supplier is read every time the configuration is requested. It's recommended to useProfileFileSupplier
that provides configurable caching for the reading of the profile file.If this is not set, the
ProfileFile.defaultProfileFile()
is used.
-
defaultProfileFileSupplier
Supplier<ProfileFile> defaultProfileFileSupplier()
-
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.This is equivalent to setting the
ProfileFileSystemSetting.AWS_CONFIG_FILE
andProfileFileSystemSetting.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 theAWS_REGION
environment variable.If this is not set, the
ProfileFile.defaultProfileFile()
is used.
-
defaultProfileFile
ProfileFile defaultProfileFile()
-
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.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.- See Also:
defaultProfileFile(ProfileFile)
-
defaultProfileName
String defaultProfileName()
-
metricPublishers
ClientOverrideConfiguration.Builder metricPublishers(List<MetricPublisher> metricPublishers)
Set the Metric publishers to be use to publish metrics for this client. This overwrites the current list of metric publishers set on the builder.- Parameters:
metricPublishers
- The metric publishers.
-
addMetricPublisher
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.- Parameters:
metricPublisher
- The metric publisher to add.
-
metricPublishers
List<MetricPublisher> metricPublishers()
-
executionAttributes
ClientOverrideConfiguration.Builder executionAttributes(ExecutionAttributes executionAttributes)
Sets the additional execution attributes collection for this client.- Parameters:
executionAttributes
- Execution attributes map for this client.- Returns:
- This object for method chaining.
-
putExecutionAttribute
<T> ClientOverrideConfiguration.Builder putExecutionAttribute(ExecutionAttribute<T> attribute, T value)
Put an execution attribute into to the existing collection of execution attributes.- Parameters:
attribute
- The execution attribute objectvalue
- The value of the execution attribute.
-
executionAttributes
ExecutionAttributes executionAttributes()
-
compressionConfiguration
ClientOverrideConfiguration.Builder compressionConfiguration(CompressionConfiguration compressionConfiguration)
Sets theCompressionConfiguration
for this client.
-
compressionConfiguration
default ClientOverrideConfiguration.Builder compressionConfiguration(Consumer<CompressionConfiguration.Builder> compressionConfiguration)
Sets theCompressionConfiguration
for this client.
-
compressionConfiguration
CompressionConfiguration compressionConfiguration()
-
-