Class CosmosUtils
- java.lang.Object
-
- com.azure.spring.data.cosmos.common.CosmosUtils
-
public class CosmosUtils extends Object
Util class to fill and process response diagnostics
-
-
Constructor Summary
Constructors Constructor Description CosmosUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidfillAndProcessCosmosExceptionDiagnostics(ResponseDiagnosticsProcessor responseDiagnosticsProcessor, CosmosException cosmosException)Generate ResponseDiagnostics with CosmosException diagnosticsstatic <T> voidfillAndProcessResponseDiagnostics(ResponseDiagnosticsProcessor responseDiagnosticsProcessor, CosmosDiagnostics cosmosDiagnostics, FeedResponse<T> feedResponse)Generate ResponseDiagnostics with cosmos and feed response diagnosticsstatic StringgetStringIDValue(Object idValue)ID value should be string value, real id type will be String, Integer, Long, all of these must be converted to String type.
-
-
-
Method Detail
-
fillAndProcessResponseDiagnostics
public static <T> void fillAndProcessResponseDiagnostics(ResponseDiagnosticsProcessor responseDiagnosticsProcessor, CosmosDiagnostics cosmosDiagnostics, FeedResponse<T> feedResponse)
Generate ResponseDiagnostics with cosmos and feed response diagnostics- Type Parameters:
T- type of cosmosResponse- Parameters:
responseDiagnosticsProcessor- collect Response Diagnostics from API responses and then set inResponseDiagnosticsobject.cosmosDiagnostics- response from cosmosfeedResponse- response from feed
-
fillAndProcessCosmosExceptionDiagnostics
public static void fillAndProcessCosmosExceptionDiagnostics(ResponseDiagnosticsProcessor responseDiagnosticsProcessor, CosmosException cosmosException)
Generate ResponseDiagnostics with CosmosException diagnostics- Parameters:
responseDiagnosticsProcessor- response diagnostics processorcosmosException- cosmos exception
-
getStringIDValue
public static String getStringIDValue(Object idValue)
ID value should be string value, real id type will be String, Integer, Long, all of these must be converted to String type.- Parameters:
idValue- id value to find- Returns:
- String id value
- Throws:
IllegalArgumentException- thrown if id value fail the validation.IllegalQueryException- thrown if id value fail the validation.
-
-