Package com.azure.cosmos.models
Class CosmosBatchResponse
- java.lang.Object
-
- com.azure.cosmos.models.CosmosBatchResponse
-
public final class CosmosBatchResponse extends Object
Response of aCosmosBatch
request.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method 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, ornull
.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.
-
-
-
Method Detail
-
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.
-
size
public int size()
Gets the number of operation results.- Returns:
- the number of operations results in this response.
-
isSuccessStatusCode
public boolean isSuccessStatusCode()
Returns a value indicating whether the batch was successfully processed.- Returns:
- a value indicating whether the batch was successfully processed.
-
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.
-
getErrorMessage
public String getErrorMessage()
Gets the reason for the failure of the batch request, if any, ornull
.- 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.
-
getStatusCode
public int getStatusCode()
Gets the HTTP status code associated with the response.- Returns:
- the status code.
-
getSessionToken
public String getSessionToken()
Gets the token used for managing client's consistency requirements.- Returns:
- the session token.
-
getResponseHeaders
public Map<String,String> getResponseHeaders()
Gets the headers associated with the response.- Returns:
- the response headers.
-
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.
-
getSubStatusCode
public int getSubStatusCode()
Gets the HTTP sub status code associated with the response.- Returns:
- the sub status code.
-
getResults
public 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.- Returns:
- Results of operations in a batch.
-
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.
-
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.
-
-