Package io.micronaut.data.cosmos.common
Class CosmosUtils
- java.lang.Object
-
- io.micronaut.data.cosmos.common.CosmosUtils
-
@Internal public final class CosmosUtils extends java.lang.Object
The utility class for Cosmos operations, currently used for diagnostic processing and error handling.- Since:
- 3.9.0
- Author:
- radovanradic
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CosmosAccessException
cosmosAccessException(CosmosDiagnosticsProcessor cosmosDiagnosticsProcessor, java.lang.String operationName, java.lang.String message, java.lang.Throwable throwable)
ReturnsCosmosAccessException
and processes diagnostics if wrapped exception isCosmosException
.static void
processDiagnostics(CosmosDiagnosticsProcessor cosmosDiagnosticsProcessor, java.lang.String operationName, com.azure.cosmos.CosmosDiagnostics cosmosDiagnostics, java.lang.String activityId, double requestCharge)
Processes diagnostics from the Cosmos response.
-
-
-
Method Detail
-
cosmosAccessException
public static CosmosAccessException cosmosAccessException(CosmosDiagnosticsProcessor cosmosDiagnosticsProcessor, java.lang.String operationName, java.lang.String message, java.lang.Throwable throwable)
ReturnsCosmosAccessException
and processes diagnostics if wrapped exception isCosmosException
.- Parameters:
cosmosDiagnosticsProcessor
- the Cosmos response diagnostics processoroperationName
- the operation namemessage
- the detail messagethrowable
- exception- Returns:
- CosmosAccessException for operations on Cosmos Db
-
processDiagnostics
public static void processDiagnostics(CosmosDiagnosticsProcessor cosmosDiagnosticsProcessor, java.lang.String operationName, @Nullable com.azure.cosmos.CosmosDiagnostics cosmosDiagnostics, @Nullable java.lang.String activityId, double requestCharge)
Processes diagnostics from the Cosmos response.- Parameters:
cosmosDiagnosticsProcessor
- the Cosmos response diagnostics processoroperationName
- the operation namecosmosDiagnostics
- the Cosmos diagnosticsactivityId
- the activity id (will be null in case of cross partition queries)requestCharge
- the request charge for the operation
-
-