Class ConsistencyPolicy
java.lang.Object
com.microsoft.azure.management.cosmosdb.ConsistencyPolicy
The consistency policy for the Cosmos DB database account.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the default consistency level and configuration settings of the Cosmos DB account.Get when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated.Get when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated.withDefaultConsistencyLevel
(DefaultConsistencyLevel defaultConsistencyLevel) Set the default consistency level and configuration settings of the Cosmos DB account.withMaxIntervalInSeconds
(Integer maxIntervalInSeconds) Set when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated.withMaxStalenessPrefix
(Long maxStalenessPrefix) Set when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated.
-
Constructor Details
-
ConsistencyPolicy
public ConsistencyPolicy()
-
-
Method Details
-
defaultConsistencyLevel
Get the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.- Returns:
- the defaultConsistencyLevel value
-
withDefaultConsistencyLevel
public ConsistencyPolicy withDefaultConsistencyLevel(DefaultConsistencyLevel defaultConsistencyLevel) Set the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.- Parameters:
defaultConsistencyLevel
- the defaultConsistencyLevel value to set- Returns:
- the ConsistencyPolicy object itself.
-
maxStalenessPrefix
Get when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.- Returns:
- the maxStalenessPrefix value
-
withMaxStalenessPrefix
Set when used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated. Accepted range for this value is 1 – 2,147,483,647. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.- Parameters:
maxStalenessPrefix
- the maxStalenessPrefix value to set- Returns:
- the ConsistencyPolicy object itself.
-
maxIntervalInSeconds
Get when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.- Returns:
- the maxIntervalInSeconds value
-
withMaxIntervalInSeconds
Set when used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated. Accepted range for this value is 5 - 86400. Required when defaultConsistencyPolicy is set to 'BoundedStaleness'.- Parameters:
maxIntervalInSeconds
- the maxIntervalInSeconds value to set- Returns:
- the ConsistencyPolicy object itself.
-