RequestOptions Class
- java.
lang. Object - com.
microsoft. azure. storage. RequestOptions
- com.
public class RequestOptions
Represents the options to use while processing a given request.
Constructor Summary
Constructor | Description |
---|---|
RequestOptions() |
Creates an instance of the class. |
RequestOptions(final RequestOptions other) |
Creates an instance of the class by copying values from another instance. |
Method Summary
Modifier and Type | Method and Description |
---|---|
void |
applyBaseDefaultsInternal(final RequestOptions modifiedOptions)
Populates the default timeout, retry policy, and location mode from client if they are null. |
Boolean |
disableHttpsSocketKeepAlive()
Gets a value to indicate whether https socket keep-alive should be disabled. Use to disable keep-alive; otherwise, . For more information about disableHttpsSocketKeepAlive defaults, see getDefaultRequestOptions() |
final Location |
getLocationMode()
Gets the default location mode for this request. For more information about location mode, see setLocationMode(final LocationMode locationMode). |
Integer |
getMaximumExecutionTimeInMs()
Gets the maximum execution time for this request. For more information about maximum execution time defaults, see setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs). |
Long |
getOperationExpiryTimeInMs()
RESERVED FOR INTERNAL USE. Returns the time at which this operation expires. This is computed by adding the time the operation begins and the maximum execution time and will be null if maximum execution time is null. For more information about maximum execution time, see setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs). |
final Retry |
getRetryPolicyFactory()
Gets the retry policy to use for this request. For more information about the retry policy defaults, see setRetryPolicyFactory(final RetryPolicyFactory retryPolicyFactory). |
final Integer |
getTimeoutIntervalInMs()
Returns the timeout value for this request. For more information about the timeout defaults, see setTimeoutIntervalInMs(final Integer timeoutIntervalInMs). |
void |
populateRequestOptions(RequestOptions modifiedOptions, final RequestOptions clientOptions, final 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. Use to encrypt/decrypt data for transactions; otherwise, . For more information about require encryption defaults, see setRequireEncryption(Boolean requireEncryption). |
void |
setDisableHttpsSocketKeepAlive(Boolean disableHttpsSocketKeepAlive)
Sets a value to indicate whether https socket keep-alive should be disabled. Use to disable keep-alive; otherwise, The default is set in the client and is by default true, indicating that https socket keep-alive will be disabled. You can change the value on this request by setting this property. You can also change the value on on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use the appropriate value. Setting keep-alive on https sockets is to work around a bug in the JVM where connection timeouts are not honored on retried requests. In those cases, you may choose to use socket keep-alive as a fallback. Unfortunately, the timeout value must be taken from a JVM property rather than configured locally. Therefore, in rare cases the JVM has configured aggressively short keep-alive times, it may not be beneficial to enable the use of keep-alives lest they interfere with long running data transfer operations. |
void |
setLocationMode(final LocationMode locationMode)
Sets the LocationMode for this request. The default LocationMode is set in the client and is by default PRIMARY_ONLY. You can change the LocationMode on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that LocationMode. |
void |
setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs)
Sets the maximum execution time to use when making this request. 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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use the maximum execution time. |
void |
setRequireEncryption(Boolean requireEncryption)
Sets a value to indicate whether all data written and read must be encrypted. Use to encrypt/decrypt data for transactions; otherwise, . 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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use the appropriate value. |
final void |
setRetryPolicyFactory(final RetryPolicyFactory retryPolicyFactory)
Sets the RetryPolicyFactory object to use for this request. 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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that RetryPolicyFactory. |
final void |
setTimeoutIntervalInMs(final Integer timeoutIntervalInMs)
Sets the timeout to use when making this request. 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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that server timeout. |
Constructor Details
RequestOptions
public RequestOptions()
Creates an instance of the class.
RequestOptions
public RequestOptions(final RequestOptions other)
Creates an instance of the class by copying values from another instance.
Parameters:
RequestOptions
object that represents the request options to copy.
Method Details
applyBaseDefaultsInternal
protected static void applyBaseDefaultsInternal(final RequestOptions modifiedOptions)
Populates the default timeout, retry policy, and location mode from client if they are null.
Parameters:
disableHttpsSocketKeepAlive
public Boolean disableHttpsSocketKeepAlive()
Gets a value to indicate whether https socket keep-alive should be disabled. Use to disable keep-alive; otherwise, . For more information about disableHttpsSocketKeepAlive defaults, see getDefaultRequestOptions()
Returns:
getLocationMode
public final LocationMode getLocationMode()
Gets the default location mode for this request. For more information about location mode, see setLocationMode(final LocationMode locationMode).
Returns:
getMaximumExecutionTimeInMs
public Integer getMaximumExecutionTimeInMs()
Gets the maximum execution time for this request. For more information about maximum execution time defaults, see setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs).
Returns:
getOperationExpiryTimeInMs
public Long getOperationExpiryTimeInMs()
RESERVED FOR INTERNAL USE.
Returns the time at which this operation expires. This is computed by adding the time the operation begins and the maximum execution time and will be null if maximum execution time is null. For more information about maximum execution time, see setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs).
Returns:
getRetryPolicyFactory
public final RetryPolicyFactory getRetryPolicyFactory()
Gets the retry policy to use for this request. For more information about the retry policy defaults, see setRetryPolicyFactory(final RetryPolicyFactory retryPolicyFactory).
Returns:
getTimeoutIntervalInMs
public final Integer getTimeoutIntervalInMs()
Returns the timeout value for this request. For more information about the timeout defaults, see setTimeoutIntervalInMs(final Integer timeoutIntervalInMs).
Returns:
populateRequestOptions
protected static void populateRequestOptions(RequestOptions modifiedOptions, final RequestOptions clientOptions, final boolean setStartTime)
Populates any null fields in the first requestOptions object with values from the second requestOptions object.
Parameters:
requireEncryption
public Boolean requireEncryption()
Gets a value to indicate whether all data written and read must be encrypted. Use to encrypt/decrypt data for transactions; otherwise, . For more information about require encryption defaults, see setRequireEncryption(Boolean requireEncryption).
Returns:
setDisableHttpsSocketKeepAlive
public void setDisableHttpsSocketKeepAlive(Boolean disableHttpsSocketKeepAlive)
Sets a value to indicate whether https socket keep-alive should be disabled. Use to disable keep-alive; otherwise,
The default is set in the client and is by default true, indicating that https socket keep-alive will be disabled. You can change the value on this request by setting this property. You can also change the value on on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use the appropriate value.
Setting keep-alive on https sockets is to work around a bug in the JVM where connection timeouts are not honored on retried requests. In those cases, you may choose to use socket keep-alive as a fallback. Unfortunately, the timeout value must be taken from a JVM property rather than configured locally. Therefore, in rare cases the JVM has configured aggressively short keep-alive times, it may not be beneficial to enable the use of keep-alives lest they interfere with long running data transfer operations.
Parameters:
setLocationMode
public void setLocationMode(final LocationMode locationMode)
Sets the LocationMode for this request.
The default LocationMode is set in the client and is by default PRIMARY_ONLY. You can change the LocationMode on this request by setting this property. You can also change the value on the getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that LocationMode.
Parameters:
setMaximumExecutionTimeInMs
public void setMaximumExecutionTimeInMs(Integer maximumExecutionTimeInMs)
Sets the maximum execution time to use when making this request.
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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use the maximum execution time.
Parameters:
setRequireEncryption
public void setRequireEncryption(Boolean requireEncryption)
Sets a value to indicate whether all data written and read must be encrypted. Use to encrypt/decrypt data for transactions; otherwise, .
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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use the appropriate value.
Parameters:
setRetryPolicyFactory
public final void setRetryPolicyFactory(final RetryPolicyFactory retryPolicyFactory)
Sets the RetryPolicyFactory object to use for this request.
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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that RetryPolicyFactory.
Parameters:
setTimeoutIntervalInMs
public final void setTimeoutIntervalInMs(final Integer timeoutIntervalInMs)
Sets the timeout to use when making this request.
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 getDefaultRequestOptions() object so that all subsequent requests made via the service client will use that server timeout.
Parameters:
Applies to
Azure SDK for Java