Package com.azure.data.cosmos
Class ConsistencyPolicy
- java.lang.Object
-
- com.azure.data.cosmos.JsonSerializable
-
- com.azure.data.cosmos.ConsistencyPolicy
-
public final class ConsistencyPolicy extends JsonSerializable
Encapsulates the properties for consistency policy in the Azure Cosmos DB database service.
-
-
Constructor Summary
Constructors Constructor Description ConsistencyPolicy()
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ConsistencyLevel
defaultConsistencyLevel()
Get the name of the resource.ConsistencyPolicy
defaultConsistencyLevel(ConsistencyLevel level)
Set the name of the resource.int
maxStalenessIntervalInSeconds()
Gets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.ConsistencyPolicy
maxStalenessIntervalInSeconds(int maxStalenessIntervalInSeconds)
Sets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.int
maxStalenessPrefix()
Gets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version).ConsistencyPolicy
maxStalenessPrefix(int maxStalenessPrefix)
Sets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version).-
Methods inherited from class com.azure.data.cosmos.JsonSerializable
get, getBoolean, getCollection, getDouble, getInt, getList, getLogger, getLong, getMap, getObject, getObjectByPath, getString, has, toJson, toJson, toObject, toString
-
-
-
-
Method Detail
-
defaultConsistencyLevel
public ConsistencyLevel defaultConsistencyLevel()
Get the name of the resource.- Returns:
- the default consistency level.
-
defaultConsistencyLevel
public ConsistencyPolicy defaultConsistencyLevel(ConsistencyLevel level)
Set the name of the resource.- Parameters:
level
- the consistency level.- Returns:
- the ConsistenctPolicy.
-
maxStalenessPrefix
public int maxStalenessPrefix()
Gets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version).- Returns:
- the max staleness prefix.
-
maxStalenessPrefix
public ConsistencyPolicy maxStalenessPrefix(int maxStalenessPrefix)
Sets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version).- Parameters:
maxStalenessPrefix
- the max staleness prefix.- Returns:
- the ConsistenctPolicy.
-
maxStalenessIntervalInSeconds
public int maxStalenessIntervalInSeconds()
Gets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.- Returns:
- the max staleness prefix.
-
maxStalenessIntervalInSeconds
public ConsistencyPolicy maxStalenessIntervalInSeconds(int maxStalenessIntervalInSeconds)
Sets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.- Parameters:
maxStalenessIntervalInSeconds
- the max staleness interval in seconds.- Returns:
- the ConsistenctPolicy.
-
-