ClientConfiguration
.@NotThreadSafe @Deprecated public class LegacyClientConfiguration extends Object
Modifier and Type | Field | Description |
---|---|---|
static int |
DEFAULT_CLIENT_EXECUTION_TIMEOUT |
Deprecated.
The default timeout for a request.
|
static int |
DEFAULT_MAX_CONNECTIONS |
Deprecated.
The default max connection pool size.
|
static int |
DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING |
Deprecated.
|
static RetryPolicy |
DEFAULT_RETRY_POLICY |
Deprecated.
Default request retry policy, including the maximum retry count of 3, the default retry
condition and the default back-off strategy.
|
static boolean |
DEFAULT_THROTTLE_RETRIES |
Deprecated.
The default on whether to throttle retries.
|
static boolean |
DEFAULT_USE_GZIP |
Deprecated.
The default on whether to use gzip compression.
|
static String |
DEFAULT_USER_AGENT |
Deprecated.
The default HTTP user agent header for AWS Java SDK clients.
|
Constructor | Description |
---|---|
LegacyClientConfiguration() |
Deprecated.
Create a legacy client configuration object with default options.
|
LegacyClientConfiguration(LegacyClientConfiguration other) |
Deprecated.
Create a copy of another legacy client configuration object.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addHeader(String name,
String value) |
Deprecated.
Adds a header to be added on all requests
|
int |
getClientExecutionTimeout() |
Deprecated.
Returns the amount of time (in milliseconds) to allow the client to complete the execution of
an API call.
|
Map<String,String> |
getHeaders() |
Deprecated.
Returns headers to be added to all requests
|
int |
getMaxConsecutiveRetriesBeforeThrottling() |
Deprecated.
|
int |
getMaxErrorRetry() |
Deprecated.
Returns the maximum number of retry attempts for failed retryable requests (ex: 5xx error
responses from a service).
|
Protocol |
getProtocol() |
Deprecated.
Returns the protocol (HTTP or HTTPS) to use when connecting to Amazon Web Services.
|
RetryPolicy |
getRetryPolicy() |
Deprecated.
Returns the retry policy upon failed requests.
|
String |
getSignerOverride() |
Deprecated.
Returns the name of the signature algorithm to use for signing requests made by this client.
|
String |
getUserAgent() |
Deprecated.
Replaced by
getUserAgentPrefix() and getUserAgentSuffix() |
String |
getUserAgentPrefix() |
Deprecated.
Returns the HTTP user agent header prefix to send with all requests.
|
String |
getUserAgentSuffix() |
Deprecated.
Returns the HTTP user agent header suffix to add to the end of the user agent header on all requests.
|
void |
setClientExecutionTimeout(int clientExecutionTimeout) |
Deprecated.
Sets the amount of time (in milliseconds) to allow the client to complete the execution of
an API call.
|
void |
setMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling) |
Deprecated.
Set the maximum number of consecutive failed retries that the client will permit before
throttling all subsequent retries of failed requests.
|
void |
setMaxErrorRetry(int maxErrorRetry) |
Deprecated.
Sets the maximum number of retry attempts for failed retryable requests (ex: 5xx error
responses from services).
|
void |
setProtocol(Protocol protocol) |
Deprecated.
Sets the protocol (i.e.
|
void |
setRetryPolicy(RetryPolicy retryPolicy) |
Deprecated.
Sets the retry policy upon failed requests.
|
void |
setSignerOverride(String value) |
Deprecated.
Sets the name of the signature algorithm to use for signing requests made by this client.
|
void |
setUseGzip(boolean use) |
Deprecated.
Sets whether gzip compression should be used
|
void |
setUserAgent(String userAgent) |
Deprecated.
Replaced by
setUserAgentPrefix(String) and setUserAgentSuffix(String) |
void |
setUserAgentPrefix(String prefix) |
Deprecated.
Sets the HTTP user agent prefix to send with all requests.
|
void |
setUserAgentSuffix(String suffix) |
Deprecated.
Sets the HTTP user agent suffix to send with all requests.
|
void |
setUseThrottleRetries(boolean use) |
Deprecated.
Sets whether throttled retries should be used
|
boolean |
useGzip() |
Deprecated.
Checks if gzip compression is used
|
boolean |
useThrottledRetries() |
Deprecated.
Returns whether retry throttling will be used.
|
LegacyClientConfiguration |
withClientExecutionTimeout(int clientExecutionTimeout) |
Deprecated.
Sets the amount of time (in milliseconds) to allow the client to complete the execution of
an API call.
|
LegacyClientConfiguration |
withGzip(boolean use) |
Deprecated.
Sets whether gzip compression should be used
|
LegacyClientConfiguration |
withHeader(String name,
String value) |
Deprecated.
Adds a header to be added on all requests and returns the
LegacyClientConfiguration object |
LegacyClientConfiguration |
withMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling) |
Deprecated.
Set the maximum number of consecutive failed retries that the client will permit before
throttling all subsequent retries of failed requests.
|
LegacyClientConfiguration |
withMaxErrorRetry(int maxErrorRetry) |
Deprecated.
Sets the maximum number of retry attempts for failed retryable requests (ex: 5xx error
responses from services), and returns the updated ClientConfiguration object.
|
LegacyClientConfiguration |
withProtocol(Protocol protocol) |
Deprecated.
Sets the protocol (i.e.
|
LegacyClientConfiguration |
withRetryPolicy(RetryPolicy retryPolicy) |
Deprecated.
Sets the retry policy upon failed requests, and returns the updated ClientConfiguration
object.
|
LegacyClientConfiguration |
withSignerOverride(String value) |
Deprecated.
Sets the name of the signature algorithm to use for signing requests made by this client.
|
LegacyClientConfiguration |
withThrottledRetries(boolean use) |
Deprecated.
Sets whether throttled retries should be used
|
LegacyClientConfiguration |
withUserAgent(String userAgent) |
Deprecated.
Replaced by
withUserAgentPrefix(String) and withUserAgentSuffix(String) |
LegacyClientConfiguration |
withUserAgentPrefix(String prefix) |
Deprecated.
Sets the HTTP user agent prefix header used in requests and returns the updated ClientConfiguration
object.
|
LegacyClientConfiguration |
withUserAgentSuffix(String suffix) |
Deprecated.
Sets the HTTP user agent suffix header used in requests and returns the updated ClientConfiguration
object.
|
public static final int DEFAULT_CLIENT_EXECUTION_TIMEOUT
public static final int DEFAULT_MAX_CONNECTIONS
public static final String DEFAULT_USER_AGENT
public static final RetryPolicy DEFAULT_RETRY_POLICY
public static final boolean DEFAULT_USE_GZIP
public static final boolean DEFAULT_THROTTLE_RETRIES
public static final int DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING
public LegacyClientConfiguration()
public LegacyClientConfiguration(LegacyClientConfiguration other)
public Protocol getProtocol()
The default configuration is to use HTTPS for all requests for increased security.
Individual clients can also override this setting by explicitly including the protocol as
part of the endpoint URL when calling AmazonWebServiceClient.setEndpoint(String)
.
public void setProtocol(Protocol protocol)
The default configuration is to use HTTPS for all requests for increased security.
Individual clients can also override this setting by explicitly including the protocol as
part of the endpoint URL when calling AmazonWebServiceClient.setEndpoint(String)
.
protocol
- The protocol to use when connecting to Amazon Web Services.public LegacyClientConfiguration withProtocol(Protocol protocol)
The default configuration is to use HTTPS for all requests for increased security.
Individual clients can also override this setting by explicitly including the protocol as
part of the endpoint URL when calling AmazonWebServiceClient.setEndpoint(String)
.
protocol
- The protocol to use when connecting to Amazon Web Services.@Deprecated public String getUserAgent()
getUserAgentPrefix()
and getUserAgentSuffix()
@Deprecated public void setUserAgent(String userAgent)
setUserAgentPrefix(String)
and setUserAgentSuffix(String)
userAgent
- The user agent string to use when sending requests.@Deprecated public LegacyClientConfiguration withUserAgent(String userAgent)
withUserAgentPrefix(String)
and withUserAgentSuffix(String)
userAgent
- The user agent string to use when sending requests.public String getUserAgentPrefix()
public void setUserAgentPrefix(String prefix)
prefix
- The string to prefix to user agent to use when sending requests.public LegacyClientConfiguration withUserAgentPrefix(String prefix)
prefix
- The string to prefix to user agent to use when sending requests.public String getUserAgentSuffix()
public void setUserAgentSuffix(String suffix)
suffix
- The string to suffix to user agent to use when sending requests.public LegacyClientConfiguration withUserAgentSuffix(String suffix)
suffix
- The string to suffix to user agent to use when sending requests.public RetryPolicy getRetryPolicy()
public void setRetryPolicy(RetryPolicy retryPolicy)
setMaxErrorRetry(int)
.retryPolicy
- The retry policy upon failed requests.public LegacyClientConfiguration withRetryPolicy(RetryPolicy retryPolicy)
setMaxErrorRetry(int)
retryPolicy
- The retry policy upon failed requests.public int getMaxErrorRetry()
setMaxErrorRetry(int)
, in which case the configured RetryPolicy will be used
to control the retry count.setMaxErrorRetry(int)
.public void setMaxErrorRetry(int maxErrorRetry)
maxErrorRetry
- The maximum number of retry attempts for failed retryable requests. This value
should not be negative.public LegacyClientConfiguration withMaxErrorRetry(int maxErrorRetry)
maxErrorRetry
- The maximum number of retry attempts for failed retryable requests. This value
should not be negative.public int getClientExecutionTimeout()
This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.
The client execution 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.
public void setClientExecutionTimeout(int clientExecutionTimeout)
This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.
The client execution 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.
clientExecutionTimeout
- The amount of time (in milliseconds) to allow the client to complete the execution
of an API call. A value of '0' disables this feature.public LegacyClientConfiguration withClientExecutionTimeout(int clientExecutionTimeout)
This feature requires buffering the entire response (for non-streaming APIs) into memory to enforce a hard timeout when reading the response. For APIs that return large responses this could be expensive.
The client execution 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.
clientExecutionTimeout
- The amount of time (in milliseconds) to allow the client to complete the execution
of an API call. A value of '0' disables this feature.public boolean useThrottledRetries()
Retry throttling is a feature which intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful, particularly in scenarios of degraded service health. In these situations the client will drain its internal retry capacity and slowly roll off from retry attempts until requests begin to succeed again. At that point the retry capacity pool will begin to refill and retries will once again be permitted.
In situations where retries have been throttled this feature will effectively result in fail-fast behavior from the client. Because retries are circumvented exceptions will be immediately returned to the caller if the initial request is unsuccessful. This will result in a greater number of exceptions being returned up front but prevents requests being tied up attempting subsequent retries which are also likely to fail.
public void setUseThrottleRetries(boolean use)
Retry throttling is a feature which intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful, particularly in scenarios of degraded service health. In these situations the client will drain its internal retry capacity and slowly roll off from retry attempts until requests begin to succeed again. At that point the retry capacity pool will begin to refill and retries will once again be permitted.
In situations where retries have been throttled this feature will effectively result in fail-fast behavior from the client. Because retries are circumvented exceptions will be immediately returned to the caller if the initial request is unsuccessful. This will result in a greater number of exceptions being returned up front but prevents requests being tied up attempting subsequent retries which are also likely to fail.
use
- true if throttled retries should be usedpublic LegacyClientConfiguration withThrottledRetries(boolean use)
Retry throttling is a feature which intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful, particularly in scenarios of degraded service health. In these situations the client will drain its internal retry capacity and slowly roll off from retry attempts until requests begin to succeed again. At that point the retry capacity pool will begin to refill and retries will once again be permitted.
In situations where retries have been throttled this feature will effectively result in fail-fast behavior from the client. Because retries are circumvented exceptions will be immediately returned to the caller if the initial request is unsuccessful. This will result in a greater number of exceptions being returned up front but prevents requests being tied up attempting subsequent retries which are also likely to fail.
use
- true if throttled retries should be usedpublic void setMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling)
Note: This does not guarantee that each failed request will be retried up to this many times.
Depending on the configured RetryPolicy
and the number of past failed and successful
requests, the actual number of retries attempted may be less.
This has a default value of DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING
.
maxConsecutiveRetriesBeforeThrottling
- The maximum number of consecutive retries.public LegacyClientConfiguration withMaxConsecutiveRetriesBeforeThrottling(int maxConsecutiveRetriesBeforeThrottling)
Note: This does not guarantee that each failed request will be retried up to this many times.
Depending on the configured RetryPolicy
and the number of past failed and successful
requests, the actual number of retries attempted may be less.
This has a default value of DEFAULT_MAX_CONSECUTIVE_RETRIES_BEFORE_THROTTLING
.
maxConsecutiveRetriesBeforeThrottling
- The maximum number of consecutive retries.public int getMaxConsecutiveRetriesBeforeThrottling()
public boolean useGzip()
public void setUseGzip(boolean use)
use
- whether gzip compression should be usedpublic LegacyClientConfiguration withGzip(boolean use)
use
- whether gzip compression should be usedpublic String getSignerOverride()
Most users do not need to concern themselves with which signature algorithm is being used, as the defaults will be sufficient. This setting exists only so advanced users can opt in to newer signature protocols which have not yet been made the default for a particular service/region.
Not all services support all signature algorithms, and configuring an unsupported signature algorithm will lead to authentication failures. Use me at your own risk, and only after consulting the documentation for the service to ensure it actually does supports your chosen algorithm.
If non-null, the name returned from this method is used to look up a Signer
class
implementing the chosen algorithm by the software.amazon.awssdk.auth.SignerFactory
class.
public void setSignerOverride(String value)
Most users do not need to concern themselves with which signature algorithm is being used, as the defaults will be sufficient. This setting exists only so advanced users can opt in to newer signature protocols which have not yet been made the default for a particular service/region.
Not all services support all signature algorithms, and configuring an unsupported signature algorithm will lead to authentication failures. Use me at your own risk, and only after consulting the documentation for the service to ensure it actually does supports your chosen algorithm.
If non-null, the name returned from this method is used to look up a Signer
class
implementing the chosen algorithm by the software.amazon.awssdk.auth.SignerFactory
class.
value
- The signature algorithm to use for this client, or null to use the default.public LegacyClientConfiguration withSignerOverride(String value)
Most users do not need to concern themselves with which signature algorithm is being used, as the defaults will be sufficient. This setting exists only so advanced users can opt in to newer signature protocols which have not yet been made the default for a particular service/region.
Not all services support all signature algorithms, and configuring an unsupported signature algorithm will lead to authentication failures. Use me at your own risk, and only after consulting the documentation for the service to ensure it actually does supports your chosen algorithm.
If non-null, the name returned from this method is used to look up a Signer
class
implementing the chosen algorithm by the software.amazon.awssdk.auth.SignerFactory
class.
value
- The signature algorithm to use for this client, or null to use the default.public LegacyClientConfiguration withHeader(String name, String value)
LegacyClientConfiguration
objectname
- the name of the headervalue
- the value of the headerpublic void addHeader(String name, String value)
name
- the name of the headervalue
- the value of the headerCopyright © 2017 Amazon Web Services, Inc. All Rights Reserved.