Class ConsistencyPolicy
java.lang.Object
com.azure.resourcemanager.cosmos.models.ConsistencyPolicy
The consistency policy for the Cosmos DB database account.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the defaultConsistencyLevel property: The default consistency level and configuration settings of the Cosmos DB account.Get the maxIntervalInSeconds property: When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated.Get the maxStalenessPrefix property: When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated.voidvalidate()Validates the instance.withDefaultConsistencyLevel(DefaultConsistencyLevel defaultConsistencyLevel) Set the defaultConsistencyLevel property: The default consistency level and configuration settings of the Cosmos DB account.withMaxIntervalInSeconds(Integer maxIntervalInSeconds) Set the maxIntervalInSeconds property: When used with the Bounded Staleness consistency level, this value represents the time amount of staleness (in seconds) tolerated.withMaxStalenessPrefix(Long maxStalenessPrefix) Set the maxStalenessPrefix property: When used with the Bounded Staleness consistency level, this value represents the number of stale requests tolerated.
-
Constructor Details
-
ConsistencyPolicy
public ConsistencyPolicy()Creates an instance of ConsistencyPolicy class.
-
-
Method Details
-
defaultConsistencyLevel
Get the defaultConsistencyLevel property: The default consistency level and configuration settings of the Cosmos DB account.- Returns:
- the defaultConsistencyLevel value.
-
withDefaultConsistencyLevel
public ConsistencyPolicy withDefaultConsistencyLevel(DefaultConsistencyLevel defaultConsistencyLevel) Set the defaultConsistencyLevel property: The default consistency level and configuration settings of the Cosmos DB account.- Parameters:
defaultConsistencyLevel- the defaultConsistencyLevel value to set.- Returns:
- the ConsistencyPolicy object itself.
-
maxStalenessPrefix
Get the maxStalenessPrefix property: 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 the maxStalenessPrefix property: 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 the maxIntervalInSeconds property: 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 the maxIntervalInSeconds property: 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.
-
validate
public void validate()Validates the instance.- Throws:
IllegalArgumentException- thrown if the instance is not valid.
-