ConsistencyPolicy Class
- java.
lang. Object - com.
microsoft. azure. documentdb. JsonSerializable - com.
microsoft. azure. documentdb. ConsistencyPolicy
- com.
- com.
public final class ConsistencyPolicy
extends JsonSerializable
Encapsulates the settings for consistency policy in the Azure Cosmos DB database service.
Constructor Summary
Constructor | Description |
---|---|
ConsistencyPolicy(String jsonString) |
Constructor. |
ConsistencyPolicy(JSONObject jsonObject) |
Constructor. |
Method Summary
Modifier and Type | Method and Description |
---|---|
Consistency |
getDefaultConsistencyLevel()
Get the name of the resource. |
int |
getMaxStalenessIntervalInSeconds()
Gets the in bounded staleness consistency, the maximum allowed staleness in terms time interval. |
int |
getMaxStalenessPrefix()
Gets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version). |
void |
setDefaultConsistencyLevel(ConsistencyLevel level)
Set the name of the resource. |
void |
setMaxStalenessIntervalInSeconds(int maxStalenessIntervalInSeconds)
Sets the in bounded staleness consistency, the maximum allowed staleness in terms time interval. |
void |
setMaxStalenessPrefix(int maxStalenessPrefix)
Sets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version). |
Methods inherited from JsonSerializable
Methods inherited from java.lang.Object
Constructor Details
ConsistencyPolicy
public ConsistencyPolicy(String jsonString)
Constructor.
Parameters:
ConsistencyPolicy
public ConsistencyPolicy(JSONObject jsonObject)
Constructor.
Parameters:
Method Details
getDefaultConsistencyLevel
public ConsistencyLevel getDefaultConsistencyLevel()
Get the name of the resource.
Returns:
getMaxStalenessIntervalInSeconds
public int getMaxStalenessIntervalInSeconds()
Gets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.
Returns:
getMaxStalenessPrefix
public int getMaxStalenessPrefix()
Gets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version).
Returns:
setDefaultConsistencyLevel
public void setDefaultConsistencyLevel(ConsistencyLevel level)
Set the name of the resource.
Parameters:
setMaxStalenessIntervalInSeconds
public void setMaxStalenessIntervalInSeconds(int maxStalenessIntervalInSeconds)
Sets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.
Parameters:
setMaxStalenessPrefix
public void setMaxStalenessPrefix(int maxStalenessPrefix)
Sets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version).
Parameters:
Applies to
Azure SDK for Java