ConsistencyPolicy Class

  • java.lang.Object

public 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.

Method Summary

Modifier and Type Method and Description
ConsistencyLevel 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).

Inherited Members

Constructor Details

ConsistencyPolicy

public ConsistencyPolicy(String jsonString)

Constructor.

Parameters:

jsonString - the json string that represents the consistency policy.

Method Details

getDefaultConsistencyLevel

public ConsistencyLevel getDefaultConsistencyLevel()

Get the name of the resource.

Returns:

the default consistency level.

getMaxStalenessIntervalInSeconds

public int getMaxStalenessIntervalInSeconds()

Gets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.

Returns:

the max staleness prefix.

getMaxStalenessPrefix

public int getMaxStalenessPrefix()

Gets the bounded staleness consistency, the maximum allowed staleness in terms difference in sequence numbers (aka version).

Returns:

the max staleness prefix.

setDefaultConsistencyLevel

public void setDefaultConsistencyLevel(ConsistencyLevel level)

Set the name of the resource.

Parameters:

level - the consistency level.

setMaxStalenessIntervalInSeconds

public void setMaxStalenessIntervalInSeconds(int maxStalenessIntervalInSeconds)

Sets the in bounded staleness consistency, the maximum allowed staleness in terms time interval.

Parameters:

maxStalenessIntervalInSeconds - the max staleness interval in seconds.

setMaxStalenessPrefix

public void setMaxStalenessPrefix(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.

Applies to