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 for ClientOverrideConfiguration.

All implementations of this interface are mutable and not thread safe.

  • Method Details

    • 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

      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

      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.
    • headers

      Map<String,List<String>> headers()
    • retryPolicy

      Configure the retry policy that should be used when handling failure cases.
      See Also:
    • 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 for retryPolicy(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 or 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.

      See Also:
    • 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.

      See Also:
    • 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.

      See Also:
    • 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.

      See Also:
    • 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.

      See Also:
    • apiCallAttemptTimeout

      Duration apiCallAttemptTimeout()
    • 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 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.

      See Also:
    • 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:
    • 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 object
      value - The value of the execution attribute.
    • executionAttributes

      ExecutionAttributes executionAttributes()
    • compressionConfiguration

      ClientOverrideConfiguration.Builder compressionConfiguration(CompressionConfiguration compressionConfiguration)
      Sets the CompressionConfiguration for this client.
    • compressionConfiguration

      default ClientOverrideConfiguration.Builder compressionConfiguration(Consumer<CompressionConfiguration.Builder> compressionConfiguration)
      Sets the CompressionConfiguration for this client.
    • compressionConfiguration

      CompressionConfiguration compressionConfiguration()