Package com.azure.cosmos
Class CosmosEndToEndOperationLatencyPolicyConfigBuilder
java.lang.Object
com.azure.cosmos.CosmosEndToEndOperationLatencyPolicyConfigBuilder
Builder for CosmosEndToEndOperationLatencyPolicyConfig
-
Constructor Summary
ConstructorDescriptionCosmosEndToEndOperationLatencyPolicyConfigBuilder
(Duration endToEndOperationTimeout) Create a builder forCosmosEndToEndOperationLatencyPolicyConfig
with end to end operation timeout -
Method Summary
Modifier and TypeMethodDescriptionavailabilityStrategy
(AvailabilityStrategy availabilityStrategy) Sets the availability strategy to be used for the policy.build()
BuildsCosmosEndToEndOperationLatencyPolicyConfig
with specified propertiesenable
(boolean isEnabled) Enables or disables the policy.
-
Constructor Details
-
CosmosEndToEndOperationLatencyPolicyConfigBuilder
Create a builder forCosmosEndToEndOperationLatencyPolicyConfig
with end to end operation timeout- Parameters:
endToEndOperationTimeout
- the timeout for request cancellation in Duration. Setting very low timeouts can cause the request to never succeed.
-
-
Method Details
-
build
BuildsCosmosEndToEndOperationLatencyPolicyConfig
with specified properties- Returns:
- the
CosmosEndToEndOperationLatencyPolicyConfig
-
enable
Enables or disables the policy. It defaults to enable.OperationCancelledException
- Parameters:
isEnabled
- flag to enable or disable the policy- Returns:
- current CosmosEndToEndOperationConfigBuilder
-
availabilityStrategy
public CosmosEndToEndOperationLatencyPolicyConfigBuilder availabilityStrategy(AvailabilityStrategy availabilityStrategy) Sets the availability strategy to be used for the policy.- Parameters:
availabilityStrategy
- the availability strategy to be used for the policy- Returns:
- current CosmosEndToEndOperationConfigBuilder
-