RequestOptions Class

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

public class RequestOptions

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

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.

Map<String, String> getHeaders()

Gets the custom request options

IndexingDirective getIndexingDirective()

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

Integer getOfferThroughput()

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

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.

List<String> getPostTriggerInclude()

Gets the triggers to be invoked after the operation.

List<String> getPreTriggerInclude()

Gets the triggers to be invoked before the operation.

Map<String, Object> getProperties()

Gets the properties

Integer getResourceTokenExpirySeconds()

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

String getSessionToken()

Gets the token for use with session consistency.

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.

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 setHeader(String name, String value)

Sets the custom request option value by key

void setIndexingDirective(IndexingDirective indexingDirective)

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

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.

void setPartitionKeyRengeId(String partitionKeyRangeId)

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

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.

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 setProperties(Map<String, Object> properties)

Sets the properties used to identify the request token.

void setResourceTokenExpirySeconds(Integer resourceTokenExpirySeconds)

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

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.

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.

getHeaders

public Map getHeaders()

Gets the custom request options

Returns:

Map of custom request options

getIndexingDirective

public IndexingDirective getIndexingDirective()

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

Returns:

the indexing directive.

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.

getProperties

public Map getProperties()

Gets the properties

Returns:

Map of request options properties

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.

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.

setHeader

public void setHeader(String name, String value)

Sets the custom request option value by key

Parameters:

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

setIndexingDirective

public void setIndexingDirective(IndexingDirective indexingDirective)

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

Parameters:

indexingDirective - the indexing directive.

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.

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.

setProperties

public void setProperties(Map properties)

Sets the properties used to identify the request token.

Parameters:

properties - the properties.

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