Compartir a través de


CosmosBatchResponse Class

  • java.lang.Object
    • com.azure.cosmos.models.CosmosBatchResponse

public final class CosmosBatchResponse

Response of a CosmosBatch request.

Method Summary

Modifier and Type Method and Description
String getActivityId()

Gets the activity ID that identifies the server request made to execute the batch.

CosmosDiagnostics getDiagnostics()

Gets the diagnostics information for the current request to Azure Cosmos DB service.

Duration getDuration()

Gets the end-to-end request latency for the current request to Azure Cosmos DB service.

String getErrorMessage()

Gets the reason for the failure of the batch request, if any, or null.

double getRequestCharge()

Gets the request charge as request units (RU) consumed by the batch operation.

Map<String,String> getResponseHeaders()

Gets the headers associated with the response.

int getResponseLength()

Get the length of the response of a batch operation change it in the down path.

List<CosmosBatchOperationResult> getResults()

Get all the results of the operations in a batch in an unmodifiable instance so no one can change it in the down path.

Duration getRetryAfterDuration()

Gets the amount of time to wait before retrying this or any other request due to throttling.

String getSessionToken()

Gets the token used for managing client's consistency requirements.

int getStatusCode()

Gets the HTTP status code associated with the response.

int getSubStatusCode()

Gets the HTTP sub status code associated with the response.

boolean isSuccessStatusCode()

Returns a value indicating whether the batch was successfully processed.

int size()

Gets the number of operation results.

Methods inherited from java.lang.Object

Method Details

getActivityId

public String getActivityId()

Gets the activity ID that identifies the server request made to execute the batch.

Returns:

the activity ID that identifies the server request made to execute the batch.

getDiagnostics

public CosmosDiagnostics getDiagnostics()

Gets the diagnostics information for the current request to Azure Cosmos DB service.

Returns:

diagnostics information for the current request to Azure Cosmos DB service.

getDuration

public Duration getDuration()

Gets the end-to-end request latency for the current request to Azure Cosmos DB service.

Returns:

end-to-end request latency for the current request to Azure Cosmos DB service.

getErrorMessage

public String getErrorMessage()

Gets the reason for the failure of the batch request, if any, or null.

Returns:

the reason for the failure of the batch request, if any, or null.

getRequestCharge

public double getRequestCharge()

Gets the request charge as request units (RU) consumed by the batch operation.

For more information about the RU and factors that can impact the effective charges please visit Request Units in Azure Cosmos DB

Returns:

the request charge.

getResponseHeaders

public Map getResponseHeaders()

Gets the headers associated with the response.

Returns:

the response headers.

getResponseLength

public int getResponseLength()

Get the length of the response of a batch operation change it in the down path.

Returns:

length of the response.

getResults

public List getResults()

Get all the results of the operations in a batch in an unmodifiable instance so no one can change it in the down path.

Returns:

Results of operations in a batch.

getRetryAfterDuration

public Duration getRetryAfterDuration()

Gets the amount of time to wait before retrying this or any other request due to throttling.

Returns:

the amount of time to wait before retrying this or any other request due to throttling.

getSessionToken

public String getSessionToken()

Gets the token used for managing client's consistency requirements.

Returns:

the session token.

getStatusCode

public int getStatusCode()

Gets the HTTP status code associated with the response.

Returns:

the status code.

getSubStatusCode

public int getSubStatusCode()

Gets the HTTP sub status code associated with the response.

Returns:

the sub status code.

isSuccessStatusCode

public boolean isSuccessStatusCode()

Returns a value indicating whether the batch was successfully processed.

Returns:

a value indicating whether the batch was successfully processed.

size

public int size()

Gets the number of operation results.

Returns:

the number of operations results in this response.

Applies to