Class ConsistencyPolicy


  • public class ConsistencyPolicy
    extends Object
    The consistency policy for the Cosmos DB database account.
    • Constructor Detail

      • ConsistencyPolicy

        public ConsistencyPolicy()
    • Method Detail

      • defaultConsistencyLevel

        public DefaultConsistencyLevel defaultConsistencyLevel()
        Get the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.
        Returns:
        the defaultConsistencyLevel value
      • withDefaultConsistencyLevel

        public ConsistencyPolicy withDefaultConsistencyLevel​(DefaultConsistencyLevel defaultConsistencyLevel)
        Set the default consistency level and configuration settings of the Cosmos DB account. Possible values include: 'Eventual', 'Session', 'BoundedStaleness', 'Strong', 'ConsistentPrefix'.
        Parameters:
        defaultConsistencyLevel - the defaultConsistencyLevel value to set
        Returns:
        the ConsistencyPolicy object itself.
      • maxStalenessPrefix

        public Long maxStalenessPrefix()
        Get 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

        public ConsistencyPolicy withMaxStalenessPrefix​(Long maxStalenessPrefix)
        Set 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

        public Integer maxIntervalInSeconds()
        Get 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

        public ConsistencyPolicy withMaxIntervalInSeconds​(Integer maxIntervalInSeconds)
        Set 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.