public abstract class RequestOptions extends Object
Constructor and Description |
---|
RequestOptions()
Creates an instance of the
RequestOptions class. |
RequestOptions(RequestOptions other)
Creates an instance of the
RequestOptions class by copying values from another
RequestOptions instance. |
Modifier and Type | Method and Description |
---|---|
protected static void |
applyBaseDefaultsInternal(RequestOptions modifiedOptions)
Populates the default timeout, retry policy, and location mode from client if they are null.
|
LocationMode |
getLocationMode()
Gets the default location mode for this request.
|
Integer |
getMaximumExecutionTimeInMs()
Gets the maximum execution time for this request.
|
Long |
getOperationExpiryTimeInMs()
RESERVED FOR INTERNAL USE.
|
RetryPolicyFactory |
getRetryPolicyFactory()
Gets the retry policy to use for this request.
|
Integer |
getTimeoutIntervalInMs()
Returns the timeout value for this request.
|
protected static void |
populateRequestOptions(RequestOptions modifiedOptions,
RequestOptions clientOptions,
boolean setStartTime)
Populates any null fields in the first requestOptions object with values from the second requestOptions object.
|
Boolean |
requireEncryption()
Gets a value to indicate whether all data written and read must be encrypted.
|
void |
setLocationMode(LocationMode locationMode)
Sets the
LocationMode for this request. |
void |
setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs)
Sets the maximum execution time to use when making this request.
|
void |
setRequireEncryption(Boolean requireEncryption)
Sets a value to indicate whether all data written and read must be encrypted.
|
void |
setRetryPolicyFactory(RetryPolicyFactory retryPolicyFactory)
Sets the RetryPolicyFactory object to use for this request.
|
void |
setTimeoutIntervalInMs(Integer timeoutIntervalInMs)
Sets the timeout to use when making this request.
|
public RequestOptions()
RequestOptions
class.public RequestOptions(RequestOptions other)
RequestOptions
class by copying values from another
RequestOptions
instance.other
- A RequestOptions
object that represents the request options to copy.protected static void applyBaseDefaultsInternal(RequestOptions modifiedOptions)
modifiedOptions
- The input options to copy from when applying defaultsprotected static void populateRequestOptions(RequestOptions modifiedOptions, RequestOptions clientOptions, boolean setStartTime)
public final RetryPolicyFactory getRetryPolicyFactory()
setRetryPolicyFactory(RetryPolicyFactory)
.RetryPolicyFactory
object that represents the current retry policy.RetryPolicy
,
RetryExponentialRetry
,
RetryLinearRetry
,
RetryNoRetry
public final Integer getTimeoutIntervalInMs()
setTimeoutIntervalInMs(Integer)
.public final LocationMode getLocationMode()
setLocationMode(LocationMode)
.LocationMode
object that represents the location mode for this request.public Integer getMaximumExecutionTimeInMs()
setMaximumExecutionTimeInMs(Integer)
.public Boolean requireEncryption()
true
to
encrypt/decrypt data for transactions; otherwise, false
. For more
information about require encryption defaults, see setRequireEncryption(Boolean)
.public Long getOperationExpiryTimeInMs()
setMaximumExecutionTimeInMs(Integer)
.public final void setRetryPolicyFactory(RetryPolicyFactory retryPolicyFactory)
The default RetryPolicyFactory is set in the client and is by default RetryExponentialRetry
. You can
change the RetryPolicyFactory on this request by setting this property. You can also change the value on the
ServiceClient.getDefaultRequestOptions()
object so that all subsequent requests made via the service
client will use that RetryPolicyFactory.
retryPolicyFactory
- the RetryPolicyFactory object to use when making service requests.RetryPolicy
,
RetryExponentialRetry
,
RetryLinearRetry
,
RetryNoRetry
public final void setTimeoutIntervalInMs(Integer timeoutIntervalInMs)
The server timeout interval begins at the time that the complete request has been received by the service, and the server begins processing the response. If the timeout interval elapses before the response is returned to the client, the operation times out. The timeout interval resets with each retry, if the request is retried.
The default server timeout is set in the client and is by default null, indicating no server timeout. You can
change the server timeout on this request by setting this property. You can also change the value on the
ServiceClient.getDefaultRequestOptions()
object so that all subsequent requests made via the service
client will use that server timeout.
timeoutIntervalInMs
- The timeout, in milliseconds, to use for this request.public void setLocationMode(LocationMode locationMode)
LocationMode
for this request.
The default LocationMode
is set in the client and is by default LocationMode.PRIMARY_ONLY
. You
can change the LocationMode
on this request by setting this property. You can also change the value on
the ServiceClient.getDefaultRequestOptions()
object so that all subsequent requests made via the service
client will use that LocationMode
.
locationMode
- the locationMode to setpublic void setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs)
The maximum execution time interval begins at the time that the client begins building the request. The maximum execution time is checked intermittently while uploading data, downloading data, and before executing retries. The service will continue to upload, download, and retry until the maximum execution time is reached. At that time, any partial uploads or downloads will be cancelled and an exception will be thrown.
The default maximum execution is set in the client and is by default null, indicating no maximum time. You can
change the maximum execution time on this request by setting this property. You can also change the value on the
ServiceClient.getDefaultRequestOptions()
object so that all subsequent requests made via the service
client will use the maximum execution time.
maximumExecutionTimeInMs
- The maximum execution time, in milliseconds, to use for this request.public void setRequireEncryption(Boolean requireEncryption)
true
to
encrypt/decrypt data for transactions; otherwise, false
.
The default is set in the client and is by default false, indicating encryption is not required. You can change
the value on this request by setting this property. You can also change the value on the
ServiceClient.getDefaultRequestOptions()
object so that all subsequent requests made via the service
client will use the appropriate value.
requireEncryption
- A value to indicate whether all data written and read must be encrypted.Copyright © 2019. All rights reserved.