Class CosmosRequestOptions

java.lang.Object
com.azure.cosmos.models.CosmosRequestOptions

public final class CosmosRequestOptions extends Object
The common request options for operations. This class should be used with the addPolicy method in the CosmosClientBuilder to change request options without restarting the application.
  • Constructor Details

    • CosmosRequestOptions

      public CosmosRequestOptions()
  • Method Details

    • setCosmosEndToEndLatencyPolicyConfig

      public CosmosRequestOptions setCosmosEndToEndLatencyPolicyConfig(CosmosEndToEndOperationLatencyPolicyConfig endToEndOperationLatencyPolicyConfig)
      Sets the CosmosEndToEndLatencyPolicyConfig.
      Parameters:
      endToEndOperationLatencyPolicyConfig - the CosmosEndToEndLatencyPolicyConfig.
      Returns:
      current CosmosRequestOptions.
    • setConsistencyLevel

      public CosmosRequestOptions setConsistencyLevel(ConsistencyLevel consistencyLevel)
      Sets the consistency level.
      Parameters:
      consistencyLevel - the consistency level.
      Returns:
      current CosmosRequestOptions.
    • setContentResponseOnWriteEnabled

      public CosmosRequestOptions setContentResponseOnWriteEnabled(Boolean contentResponseOnWriteEnabled)
      Sets the content response on write enabled.
      Parameters:
      contentResponseOnWriteEnabled - the content response on write enabled.
      Returns:
      current CosmosRequestOptions.
    • setNonIdempotentWriteRetriesEnabled

      public CosmosRequestOptions setNonIdempotentWriteRetriesEnabled(Boolean nonIdempotentWriteRetriesEnabled)
      Sets the NonIdempotentWriteRetriesEnabled.
      Parameters:
      nonIdempotentWriteRetriesEnabled - the NonIdempotentWriteRetriesEnabled.
      Returns:
      current CosmosRequestOptions.
    • setDedicatedGatewayRequestOptions

      public CosmosRequestOptions setDedicatedGatewayRequestOptions(DedicatedGatewayRequestOptions dedicatedGatewayRequestOptions)
      Sets the DedicatedGatewayRequestOptions.
      Parameters:
      dedicatedGatewayRequestOptions - the DedicatedGatewayRequestOptions.
      Returns:
      current CosmosRequestOptions.
    • setExcludeRegions

      public CosmosRequestOptions setExcludeRegions(List<String> excludeRegions)
      Sets the exclude regions.
      Parameters:
      excludeRegions - the ExcludeRegions.
      Returns:
      current CosmosRequestOptions.
    • setThroughputControlGroupName

      public CosmosRequestOptions setThroughputControlGroupName(String throughputControlGroupName)
      Sets the throughput control group name.
      Parameters:
      throughputControlGroupName - the ThroughputControlGroupName.
      Returns:
      current CosmosRequestOptions.
    • setDiagnosticsThresholds

      public CosmosRequestOptions setDiagnosticsThresholds(CosmosDiagnosticsThresholds thresholds)
      Sets the CosmosDiagnosticsThresholds.
      Parameters:
      thresholds - the CosmosDiagnosticsThresholds.
      Returns:
      current CosmosRequestOptions.
    • setScanInQueryEnabled

      public CosmosRequestOptions setScanInQueryEnabled(Boolean scanInQueryEnabled)
      Sets the ScanInQueryEnabled.
      Parameters:
      scanInQueryEnabled - the ScanInQueryEnabled.
      Returns:
      current CosmosRequestOptions.
    • setMaxDegreeOfParallelism

      public CosmosRequestOptions setMaxDegreeOfParallelism(Integer maxDegreeOfParallelism)
      Sets the MaxDegreeOfParallelism.
      Parameters:
      maxDegreeOfParallelism - the MaxDegreeOfParallelism.
      Returns:
      current CosmosRequestOptions.
    • setMaxBufferedItemCount

      public CosmosRequestOptions setMaxBufferedItemCount(Integer maxBufferedItemCount)
      Sets the MaxBufferedItemCount.
      Parameters:
      maxBufferedItemCount - the MaxBufferedItemCount.
      Returns:
      current CosmosRequestOptions.
    • setResponseContinuationTokenLimitInKb

      public CosmosRequestOptions setResponseContinuationTokenLimitInKb(Integer responseContinuationTokenLimitInKb)
      Sets the ResponseContinuationTokenLimitInKb.
      Parameters:
      responseContinuationTokenLimitInKb - the ResponseContinuationTokenLimitInKb.
      Returns:
      current CosmosRequestOptions.
    • setMaxItemCount

      public CosmosRequestOptions setMaxItemCount(Integer maxItemCount)
      Sets the MaxItemCount.
      Parameters:
      maxItemCount - the MaxItemCount.
      Returns:
      current CosmosRequestOptions.
    • setQueryMetricsEnabled

      public CosmosRequestOptions setQueryMetricsEnabled(Boolean queryMetricsEnabled)
      Sets the QueryMetricsEnabled.
      Parameters:
      queryMetricsEnabled - the QueryMetricsEnabled.
      Returns:
      current CosmosRequestOptions.
    • setIndexMetricsEnabled

      public CosmosRequestOptions setIndexMetricsEnabled(Boolean indexMetricsEnabled)
      Sets the IndexMetricsEnabled.
      Parameters:
      indexMetricsEnabled - the IndexMetricsEnabled.
      Returns:
      current CosmosRequestOptions.
    • setMaxPrefetchPageCount

      public CosmosRequestOptions setMaxPrefetchPageCount(Integer maxPrefetchPageCount)
      Sets the MaxPrefetchPageCount.
      Parameters:
      maxPrefetchPageCount - the MaxPrefetchPageCount.
      Returns:
      current CosmosRequestOptions.
    • setQueryName

      public CosmosRequestOptions setQueryName(String queryName)
      Sets the QueryName.
      Parameters:
      queryName - the QueryName.
      Returns:
      current CosmosRequestOptions.
    • setKeywordIdentifiers

      public CosmosRequestOptions setKeywordIdentifiers(Set<String> keywordIdentifiers)
      Sets the keywordIdentifiers.
      Parameters:
      keywordIdentifiers - the keywordIdentifiers.
      Returns:
      current CosmosCommonRequestOptions.
    • getMaxItemCount

      public Integer getMaxItemCount()
      Gets the max item count.
      Returns:
      the max item count.
    • isQueryMetricsEnabled

      public Boolean isQueryMetricsEnabled()
      Gets the query metrics enabled.
      Returns:
      the query metrics enabled.
    • isIndexMetricsEnabled

      public Boolean isIndexMetricsEnabled()
      Gets the index metrics enabled.
      Returns:
      the index metrics enabled.
    • getQueryName

      public String getQueryName()
      Gets the query name.
      Returns:
      the query name.
    • getMaxPrefetchPageCount

      public Integer getMaxPrefetchPageCount()
      Gets the max prefetch page count.
      Returns:
      the max prefetch page count.
    • getResponseContinuationTokenLimitInKb

      public Integer getResponseContinuationTokenLimitInKb()
      Gets the response continuation token limit in KB.
      Returns:
      the response continuation token limit in KB.
    • getMaxBufferedItemCount

      public Integer getMaxBufferedItemCount()
      Gets the max buffered item count.
      Returns:
      the max buffered item count.
    • getMaxDegreeOfParallelism

      public Integer getMaxDegreeOfParallelism()
      Gets the max degree of parallelism.
      Returns:
      the max degree of parallelism.
    • getExcludedRegions

      public List<String> getExcludedRegions()
      Gets the exclude regions.
      Returns:
      the exclude regions.
    • isScanInQueryEnabled

      public Boolean isScanInQueryEnabled()
      Gets the scan in query enabled.
      Returns:
      the scan in query enabled.
    • getDiagnosticsThresholds

      public CosmosDiagnosticsThresholds getDiagnosticsThresholds()
      Gets the diagnostics thresholds.
      Returns:
      the diagnostics thresholds.
    • getThroughputControlGroupName

      public String getThroughputControlGroupName()
      Gets the throughput control group name.
      Returns:
      the throughput control group name.
    • getDedicatedGatewayRequestOptions

      public DedicatedGatewayRequestOptions getDedicatedGatewayRequestOptions()
      Gets the dedicated gateway request options.
      Returns:
      the dedicated gateway request options.
    • getNonIdempotentWriteRetriesEnabled

      public Boolean getNonIdempotentWriteRetriesEnabled()
      Gets the non idempotent write retries enabled.
      Returns:
      the non idempotent write retries enabled.
    • isContentResponseOnWriteEnabled

      public Boolean isContentResponseOnWriteEnabled()
      Gets the content response on write enabled.
      Returns:
      the content response on write enabled.
    • getConsistencyLevel

      public ConsistencyLevel getConsistencyLevel()
      Gets the consistency level.
      Returns:
      the consistency level.
    • getCosmosEndToEndLatencyPolicyConfig

      public CosmosEndToEndOperationLatencyPolicyConfig getCosmosEndToEndLatencyPolicyConfig()
      Gets the CosmosEndToEndLatencyPolicyConfig.
      Returns:
      the CosmosEndToEndLatencyPolicyConfig.
    • getKeywordIdentifiers

      public Set<String> getKeywordIdentifiers()
      Gets the keywordIdentifiers.
      Returns:
      the keywordIdentifiers.