protected abstract static class RequestOverrideConfiguration.BuilderImpl<B extends RequestOverrideConfiguration.Builder> extends Object implements RequestOverrideConfiguration.Builder<B>
Modifier | Constructor and Description |
---|---|
protected |
BuilderImpl() |
protected |
BuilderImpl(RequestOverrideConfiguration sdkRequestOverrideConfig) |
Modifier and Type | Method and Description |
---|---|
B |
addApiName(ApiName apiName)
Set the optional name of the higher level library that constructed the request.
|
B |
addApiName(Consumer<ApiName.Builder> apiNameConsumer)
Set the optional name of the higher level library that constructed the request.
|
B |
addMetricPublisher(MetricPublisher metricPublisher)
Add a metric publisher to the existing list of previously set publishers to be used for publishing metrics
for this request.
|
Duration |
apiCallAttemptTimeout() |
B |
apiCallAttemptTimeout(Duration apiCallAttemptTimeout)
Configure the amount of time to wait for the http request to complete before giving up and timing out.
|
Duration |
apiCallTimeout() |
B |
apiCallTimeout(Duration apiCallTimeout)
Configure the amount of time to allow the client to complete the execution of an API call.
|
List<ApiName> |
apiNames()
The optional names of the higher level libraries that constructed the request.
|
ExecutionAttributes |
executionAttributes() |
B |
executionAttributes(ExecutionAttributes executionAttributes)
Sets the additional execution attributes collection for this request.
|
Map<String,List<String>> |
headers()
Optional additional headers to be added to the HTTP request.
|
B |
headers(Map<String,List<String>> headers)
Add additional headers to be set on the HTTP request.
|
List<MetricPublisher> |
metricPublishers() |
B |
metricPublishers(List<MetricPublisher> metricPublishers)
Sets the metric publishers for publishing the metrics collected for this request.
|
<T> B |
putExecutionAttribute(ExecutionAttribute<T> executionAttribute,
T value)
Add an execution attribute to the existing collection of execution attributes.
|
B |
putHeader(String name,
List<String> values)
Add a single header with multiple values to be set on the HTTP request.
|
B |
putRawQueryParameter(String name,
List<String> values)
Add a single query parameter with multiple values to be set on the HTTP request.
|
Map<String,List<String>> |
rawQueryParameters()
Optional additional query parameters to be added to the HTTP request.
|
B |
rawQueryParameters(Map<String,List<String>> rawQueryParameters)
Configure query parameters to be set on the HTTP request.
|
void |
setApiCallAttemptTimeout(Duration apiCallAttemptTimeout) |
void |
setApiCallTimeout(Duration apiCallTimeout) |
void |
setExecutionAttributes(ExecutionAttributes executionAttributes) |
void |
setMetricPublishers(List<MetricPublisher> metricPublishers) |
void |
setSigner(Signer signer) |
Signer |
signer() |
B |
signer(Signer signer)
Sets the signer to use for signing the request.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
build, putHeader, putRawQueryParameter
protected BuilderImpl()
protected BuilderImpl(RequestOverrideConfiguration sdkRequestOverrideConfig)
public Map<String,List<String>> headers()
RequestOverrideConfiguration.Builder
headers
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public B putHeader(String name, List<String> values)
RequestOverrideConfiguration.Builder
This overrides any values for the given header set on the request by default by the SDK, as well as header
overrides set at the client level using
ClientOverrideConfiguration
.
This overrides any values already configured with this header name in the builder.
putHeader
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
name
- The name of the header.values
- The values of the header.public B headers(Map<String,List<String>> headers)
RequestOverrideConfiguration.Builder
This overrides any values for the given headers set on the request by default by the SDK, as well as header
overrides set at the client level using
ClientOverrideConfiguration
.
This completely overrides any values currently configured in the builder.
headers
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
headers
- The set of additional headers.public Map<String,List<String>> rawQueryParameters()
RequestOverrideConfiguration.Builder
rawQueryParameters
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public B putRawQueryParameter(String name, List<String> values)
RequestOverrideConfiguration.Builder
This overrides any values already configured with this query name in the builder.
putRawQueryParameter
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
name
- The query parameter name.values
- The query parameter values.public B rawQueryParameters(Map<String,List<String>> rawQueryParameters)
RequestOverrideConfiguration.Builder
This completely overrides any query parameters currently configured in the builder.
rawQueryParameters
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
rawQueryParameters
- The set of additional query parameters.public List<ApiName> apiNames()
RequestOverrideConfiguration.Builder
apiNames
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public B addApiName(ApiName apiName)
RequestOverrideConfiguration.Builder
addApiName
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
apiName
- The name of the library.public B addApiName(Consumer<ApiName.Builder> apiNameConsumer)
RequestOverrideConfiguration.Builder
addApiName
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
apiNameConsumer
- A Consumer
that accepts a ApiName.Builder
.public B apiCallTimeout(Duration apiCallTimeout)
RequestOverrideConfiguration.Builder
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.
This may be used together with RequestOverrideConfiguration.Builder.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).
apiCallTimeout
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
RequestOverrideConfiguration.apiCallTimeout()
public void setApiCallTimeout(Duration apiCallTimeout)
public Duration apiCallTimeout()
apiCallTimeout
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public B apiCallAttemptTimeout(Duration apiCallAttemptTimeout)
RequestOverrideConfiguration.Builder
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 request timeout feature should not be used when absolute precision is needed.
This may be used together with RequestOverrideConfiguration.Builder.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).
apiCallAttemptTimeout
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
RequestOverrideConfiguration.apiCallAttemptTimeout()
public void setApiCallAttemptTimeout(Duration apiCallAttemptTimeout)
public Duration apiCallAttemptTimeout()
apiCallAttemptTimeout
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public B signer(Signer signer)
RequestOverrideConfiguration.Builder
signer
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
signer
- Signer for signing the requestpublic void setSigner(Signer signer)
public Signer signer()
signer
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public B metricPublishers(List<MetricPublisher> metricPublishers)
RequestOverrideConfiguration.Builder
metricPublishers
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
metricPublishers
- The list metric publisher for this request.public B addMetricPublisher(MetricPublisher metricPublisher)
RequestOverrideConfiguration.Builder
addMetricPublisher
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
metricPublisher
- The metric publisher to add.public void setMetricPublishers(List<MetricPublisher> metricPublishers)
public List<MetricPublisher> metricPublishers()
metricPublishers
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public B executionAttributes(ExecutionAttributes executionAttributes)
RequestOverrideConfiguration.Builder
executionAttributes
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
executionAttributes
- Execution attributes for this requestpublic <T> B putExecutionAttribute(ExecutionAttribute<T> executionAttribute, T value)
RequestOverrideConfiguration.Builder
putExecutionAttribute
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
executionAttribute
- The execution attribute objectvalue
- The value of the execution attribute.public ExecutionAttributes executionAttributes()
executionAttributes
in interface RequestOverrideConfiguration.Builder<B extends RequestOverrideConfiguration.Builder>
public void setExecutionAttributes(ExecutionAttributes executionAttributes)
Copyright © 2022. All rights reserved.