CosmosEncryptionContainer Class
- java.
lang. Object - com.
azure. cosmos. encryption. CosmosEncryptionContainer
- com.
public final class CosmosEncryptionContainer
CosmosContainer with encryption capabilities.
Method Summary
Methods inherited from java.lang.Object
Method Details
createItem
public CosmosItemResponse
Creates a new item synchronously and returns its respective Cosmos item response.
Parameters:
Returns:
createItem
public CosmosItemResponse
Creates a new item synchronously and returns its respective Cosmos item response while specifying additional options.
The partition key value will be automatically extracted from the item's content.
Parameters:
Returns:
createItem
public CosmosItemResponse
Creates a new item synchronously and returns its respective Cosmos item response while specifying additional options.
Parameters:
Returns:
deleteItem
public CosmosItemResponse
Deletes an item in the current container.
Parameters:
Returns:
patchItem
public CosmosItemResponse
Run patch operations on an Item.
Parameters:
Returns:
queryItems
public CosmosPagedIterable
Query items in the current container returning the results as CosmosPagedIterable<T>.
Parameters:
Returns:
queryItems
public CosmosPagedIterable
Query items in the current container returning the results as CosmosPagedIterable<T>.
Parameters:
Returns:
queryItemsOnEncryptedProperties
public CosmosPagedIterable
Query for items in the current container using a SqlQuerySpecWithEncryption.
Parameters:
Returns:
readItem
public CosmosItemResponse
Reads an item in the current container while specifying additional options.
Parameters:
Returns:
readItem
public CosmosItemResponse
Reads an item in the current container.
Parameters:
Returns:
replaceItem
public CosmosItemResponse
Replaces an item in the current container.
Parameters:
Returns:
upsertItem
public CosmosItemResponse
Upserts an Cosmos item in the current container.
Parameters:
Returns:
upsertItem
public CosmosItemResponse
Upserts a item Cosmos sync item while specifying additional options.
Parameters:
Returns:
upsertItem
public CosmosItemResponse
Upserts a item Cosmos sync item while specifying additional options.
Parameters:
Returns:
executeBulkOperations
public Iterable<>
Executes list of operations in Bulk.
Parameters:
Returns:
executeBulkOperations
public Iterable<>
Executes list of operations in Bulk.
Parameters:
Returns:
deleteItem
public CosmosItemResponse
Deletes an item in the current container.
Parameters:
Returns:
executeCosmosBatch
public CosmosBatchResponse executeCosmosBatch(CosmosBatch cosmosBatch)
Executes the encrypted transactional batch.
Parameters:
Returns:
If the transactional batch executes successfully, the value returned by CosmosBatchResponse#getStatusCode on the response returned will be set to 200}.
If an operation within the transactional batch fails during execution, no changes from the batch will be committed and the status of the failing operation is made available by CosmosBatchResponse#getStatusCode or by the exception. To obtain information about the operations that failed in case of some user error like conflict, not found etc, the response can be enumerated. This returns CosmosBatchOperationResult instances corresponding to each operation in the transactional batch in the order they were added to the transactional batch. For a result corresponding to an operation within the transactional batch, use CosmosBatchOperationResult#getStatusCode to access the status of the operation. If the operation was not executed or it was aborted due to the failure of another operation within the transactional batch, the value of this field will be 424; for the operation that caused the batch to abort, the value of this field will indicate the cause of failure.
If there are issues such as request timeouts, Gone, session not available, network failure or if the service somehow returns 5xx then this will throw an exception instead of returning a CosmosBatchResponse.
Use CosmosBatchResponse#isSuccessStatusCode on the response returned to ensure that the transactional batch succeeded.
executeCosmosBatch
public CosmosBatchResponse executeCosmosBatch(CosmosBatch cosmosBatch, CosmosBatchRequestOptions requestOptions)
Executes the encrypted transactional batch.
Parameters:
Returns:
If the transactional batch executes successfully, the value returned by CosmosBatchResponse#getStatusCode on the response returned will be set to 200}.
If an operation within the transactional batch fails during execution, no changes from the batch will be committed and the status of the failing operation is made available by CosmosBatchResponse#getStatusCode or by the exception. To obtain information about the operations that failed in case of some user error like conflict, not found etc, the response can be enumerated. This returns CosmosBatchOperationResult instances corresponding to each operation in the transactional batch in the order they were added to the transactional batch. For a result corresponding to an operation within the transactional batch, use CosmosBatchOperationResult#getStatusCode to access the status of the operation. If the operation was not executed or it was aborted due to the failure of another operation within the transactional batch, the value of this field will be 424; for the operation that caused the batch to abort, the value of this field will indicate the cause of failure.
If there are issues such as request timeouts, Gone, session not available, network failure or if the service somehow returns 5xx then this will throw an exception instead of returning a CosmosBatchResponse.
Use CosmosBatchResponse#isSuccessStatusCode on the response returned to ensure that the transactional batch succeeded.
getCosmosContainer
public CosmosContainer getCosmosContainer()
Gets the CosmosContainer
Returns:
Applies to
Azure SDK for Java
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for