RequestOptions Class

  • java.lang.Object
    • com.microsoft.azure.documentdb.RequestOptions

public class RequestOptions

Encapsulates options that can be specified for a request issued to the Azure Cosmos DB database service.

Constructor Summary

Constructor Description
RequestOptions()

Method Summary

Modifier and Type Method and Description
AccessCondition getAccessCondition()

Gets the conditions associated with the request.

ConsistencyLevel getConsistencyLevel()

Gets the consistency level required for the request.

boolean getDisableRUPerMinuteUsage()

Gets the disableRUPerMinuteUsage for the current request in the Azure Cosmos DB database service.

IndexingDirective getIndexingDirective()

Gets the indexing directive (index, do not index etc).

boolean getOfferEnableRUPerMinuteThroughput()

Gets offerEnableRUPerMinuteThroughput for a collection in the Azure Cosmos DB database service.

java.lang.Integer getOfferThroughput()

Gets the throughput in the form of Request Units per second when creating a document collection.

java.lang.String getOfferType()

Gets the offer type when creating a document collection.

PartitionKey getPartitionKey()

Gets the partition key used to identify the current request's target partition.

java.util.List<java.lang.String> getPostTriggerInclude()

Gets the triggers to be invoked after the operation.

java.util.List<java.lang.String> getPreTriggerInclude()

Gets the triggers to be invoked before the operation.

java.lang.Integer getResourceTokenExpirySeconds()

Gets the expiry time for resource token.

java.lang.String getSessionToken()

Gets the token for use with session consistency.

boolean isPopulatePartitionKeyRangeStatistics()

Gets populatePartitionKeyRangeStatistics for a collection in the Azure Cosmos DB database service.

boolean isPopulateQuotaInfo()

Gets the PopulateQuotaInfo setting for document collection read requests in the Azure Cosmos DB database service.

boolean isScriptLoggingEnabled()

Gets whether Javascript stored procedure logging is enabled for the current request in the Azure Cosmos DB database service or not.

void setAccessCondition(AccessCondition accessCondition)

Sets the conditions associated with the request.

void setConsistencyLevel(ConsistencyLevel consistencyLevel)

Sets the consistency level required for the request.

void setCustomRequestOption(String key, String value)

Sets the custom request option value by key

void setDisableRUPerMinuteUsage(boolean disableRUPerMinuteUsage)

Sets the disableRUPerMinuteUsage for the current request in the Azure Cosmos DB database service.

void setIndexingDirective(IndexingDirective indexingDirective)

Sets the indexing directive (index, do not index etc).

void setOfferEnableRUPerMinuteThroughput(boolean offerEnableRUPerMinuteThroughput)

Sets offerEnableRUPerMinuteThroughput for a collection in the Azure Cosmos DB database service.

void setOfferThroughput(Integer offerThroughput)

Sets the throughput in the form of Request Units per second when creating a document collection.

void setOfferType(String offerType)

Sets the offer type when creating a document collection.

void setPartitionKey(PartitionKey partitionkey)

Sets the partition key used to identify the current request's target partition.

protected void setPartitionKeyRengeId(String partitionKeyRangeId)

Internal usage only: Sets the partition key range id used to identify the current request's target partition.

void setPopulatePartitionKeyRangeStatistics(boolean populatePartitionKeyRangeStatistics)

Sets populatePartitionKeyRangeStatistics for a collection in the Azure Cosmos DB database service.

void setPopulateQuotaInfo(boolean populateQuotaInfo)

Sets the PopulateQuotaInfo setting for document collection read requests in the Azure Cosmos DB database service.

void setPostTriggerInclude(List<String> postTriggerInclude)

Sets the triggers to be invoked after the operation.

void setPreTriggerInclude(List<String> preTriggerInclude)

Sets the triggers to be invoked before the operation.

void setResourceTokenExpirySeconds(Integer resourceTokenExpirySeconds)

Sets the expiry time for resource token.

void setScriptLoggingEnabled(boolean scriptLoggingEnabled)

Sets whether Javascript stored procedure logging is enabled for the current request in the Azure Cosmos DB database service or not.

void setSessionToken(String sessionToken)

Sets the token for use with session consistency.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Constructor Details

RequestOptions

public RequestOptions()

Method Details

getAccessCondition

public AccessCondition getAccessCondition()

Gets the conditions associated with the request.

Returns:

the access condition.

getConsistencyLevel

public ConsistencyLevel getConsistencyLevel()

Gets the consistency level required for the request.

Returns:

the consistency level.

getDisableRUPerMinuteUsage

public boolean getDisableRUPerMinuteUsage()

Gets the disableRUPerMinuteUsage for the current request in the Azure Cosmos DB database service. disableRUPerMinuteUsage is used to enable/disable Request Units(RUs)/minute capacity to serve the request if regular provisioned RUs/second is exhausted.

Returns:

true if disableRUPerMinuteUsage is set; otherwise false

getIndexingDirective

public IndexingDirective getIndexingDirective()

Gets the indexing directive (index, do not index etc).

Returns:

the indexing directive.

getOfferEnableRUPerMinuteThroughput

public boolean getOfferEnableRUPerMinuteThroughput()

Gets offerEnableRUPerMinuteThroughput for a collection in the Azure Cosmos DB database service.

Returns:

true if offerEnableRUPerMinuteThroughput; otherwise false

getOfferThroughput

public Integer getOfferThroughput()

Gets the throughput in the form of Request Units per second when creating a document collection.

Returns:

the throughput value.

getOfferType

public String getOfferType()

Gets the offer type when creating a document collection.

Returns:

the offer type.

getPartitionKey

public PartitionKey getPartitionKey()

Gets the partition key used to identify the current request's target partition.

Returns:

the partition key value.

getPostTriggerInclude

public List getPostTriggerInclude()

Gets the triggers to be invoked after the operation.

Returns:

the triggers to be invoked after the operation.

getPreTriggerInclude

public List getPreTriggerInclude()

Gets the triggers to be invoked before the operation.

Returns:

the triggers to be invoked before the operation.

getResourceTokenExpirySeconds

public Integer getResourceTokenExpirySeconds()

Gets the expiry time for resource token. Used when creating, updating, reading permission.

Returns:

the resource token expiry seconds.

getSessionToken

public String getSessionToken()

Gets the token for use with session consistency.

Returns:

the session token.

isPopulatePartitionKeyRangeStatistics

public boolean isPopulatePartitionKeyRangeStatistics()

Gets populatePartitionKeyRangeStatistics for a collection in the Azure Cosmos DB database service.

Returns:

true if populatePartitionKeyRangeStatistics; otherwise false

isPopulateQuotaInfo

public boolean isPopulateQuotaInfo()

Gets the PopulateQuotaInfo setting for document collection read requests in the Azure Cosmos DB database service. PopulateQuotaInfo is used to enable/disable getting document collection quota related stats for document collection read requests.

Returns:

true if PopulateQuotaInfo is enabled

isScriptLoggingEnabled

public boolean isScriptLoggingEnabled()

Gets whether Javascript stored procedure logging is enabled for the current request in the Azure Cosmos DB database service or not.

Returns:

true if Javascript stored procedure logging is enabled

setAccessCondition

public void setAccessCondition(AccessCondition accessCondition)

Sets the conditions associated with the request.

Parameters:

accessCondition - the access condition.

setConsistencyLevel

public void setConsistencyLevel(ConsistencyLevel consistencyLevel)

Sets the consistency level required for the request.

Parameters:

consistencyLevel - the consistency level.

setCustomRequestOption

public void setCustomRequestOption(String key, String value)

Sets the custom request option value by key

Parameters:

key - a string representing the custom option's name
value - a String representing the custom option's value

setDisableRUPerMinuteUsage

public void setDisableRUPerMinuteUsage(boolean disableRUPerMinuteUsage)

Sets the disableRUPerMinuteUsage for the current request in the Azure Cosmos DB database service. disableRUPerMinuteUsage is used to enable/disable Request Units(RUs)/minute capacity to serve the request if regular provisioned RUs/second is exhausted.

Parameters:

disableRUPerMinuteUsage - used to disable or enable disableRUPerMinuteUsage

setIndexingDirective

public void setIndexingDirective(IndexingDirective indexingDirective)

Sets the indexing directive (index, do not index etc).

Parameters:

indexingDirective - the indexing directive.

setOfferEnableRUPerMinuteThroughput

public void setOfferEnableRUPerMinuteThroughput(boolean offerEnableRUPerMinuteThroughput)

Sets offerEnableRUPerMinuteThroughput for a collection in the Azure Cosmos DB database service.

Parameters:

offerEnableRUPerMinuteThroughput - used to disable or enable offerEnableRUPerMinuteThroughput

setOfferThroughput

public void setOfferThroughput(Integer offerThroughput)

Sets the throughput in the form of Request Units per second when creating a document collection.

Parameters:

offerThroughput - the throughput value.

setOfferType

public void setOfferType(String offerType)

Sets the offer type when creating a document collection.

Parameters:

offerType - the offer type.

setPartitionKey

public void setPartitionKey(PartitionKey partitionkey)

Sets the partition key used to identify the current request's target partition.

Parameters:

partitionkey - the partition key value.

setPartitionKeyRengeId

protected void setPartitionKeyRengeId(String partitionKeyRangeId)

Internal usage only: Sets the partition key range id used to identify the current request's target partition.

Parameters:

partitionKeyRangeId - the partition key range id value.

setPopulatePartitionKeyRangeStatistics

public void setPopulatePartitionKeyRangeStatistics(boolean populatePartitionKeyRangeStatistics)

Sets populatePartitionKeyRangeStatistics for a collection in the Azure Cosmos DB database service.

Parameters:

populatePartitionKeyRangeStatistics - used to disable or enable populatePartitionKeyRangeStatistics

setPopulateQuotaInfo

public void setPopulateQuotaInfo(boolean populateQuotaInfo)

Sets the PopulateQuotaInfo setting for document collection read requests in the Azure Cosmos DB database service. PopulateQuotaInfo is used to enable/disable getting document collection quota related stats for document collection read requests.

Parameters:

populateQuotaInfo - a boolean value indicating whether PopulateQuotaInfo is enabled or not

setPostTriggerInclude

public void setPostTriggerInclude(List postTriggerInclude)

Sets the triggers to be invoked after the operation.

Parameters:

postTriggerInclude - the triggers to be invoked after the operation.

setPreTriggerInclude

public void setPreTriggerInclude(List preTriggerInclude)

Sets the triggers to be invoked before the operation.

Parameters:

preTriggerInclude - the triggers to be invoked before the operation.

setResourceTokenExpirySeconds

public void setResourceTokenExpirySeconds(Integer resourceTokenExpirySeconds)

Sets the expiry time for resource token. Used when creating, updating, reading permission.

Parameters:

resourceTokenExpirySeconds - the resource token expiry seconds.

setScriptLoggingEnabled

public void setScriptLoggingEnabled(boolean scriptLoggingEnabled)

Sets whether Javascript stored procedure logging is enabled for the current request in the Azure Cosmos DB database service or not.

Parameters:

scriptLoggingEnabled - true if stored procedure Javascript logging is enabled

setSessionToken

public void setSessionToken(String sessionToken)

Sets the token for use with session consistency.

Parameters:

sessionToken - the session token.

Applies to