Class ConsistencyPolicy


  • public final class ConsistencyPolicy
    extends JsonSerializable
    Encapsulates the properties for consistency policy in the Azure Cosmos DB database service.
    • Constructor Detail

      • ConsistencyPolicy

        public ConsistencyPolicy()
        Constructor.
    • 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.