Uses of Class
com.azure.core.util.Context
Package
Description
Package containing HTTP abstractions between the AnnotationParser, RestProxy, and HTTP client.
Package containing HttpPipelinePolicy interface and its implementations.
Package containing REST-related APIs.
An OpenTelemetry implementation of the tracing APIs required by azure-core to enable users to effectively trace their
calls and have this information submitted to an OpenTelemetry backend.
Package containing core utility classes.
Package containing core utility classes.
Package containing API for long running operations.
Package containing API for tracing.
-
Uses of Context in com.azure.core.http
Modifier and TypeMethodDescriptionHttpPipelineCallContext.getContext()
Gets the context associated to the HTTP call.Modifier and TypeMethodDescriptiondefault Mono<HttpResponse>
HttpClient.send
(HttpRequest request, Context context) Sends the provided request asynchronously with contextual information.HttpPipeline.send
(HttpRequest request, Context data) Wraps the request in a context with additional metadata and sends it through the pipeline.default HttpResponse
HttpClient.sendSync
(HttpRequest request, Context context) Sends the provided request synchronously with contextual information.HttpPipeline.sendSync
(HttpRequest request, Context data) Wraps the request in a context with additional metadata and sends it through the pipeline. -
Uses of Context in com.azure.core.http.policy
Modifier and TypeMethodDescriptionHttpRequestLoggingContext.getContext()
Gets the contextual information about the HTTP request.HttpResponseLoggingContext.getContext()
Gets the contextual information about the HTTP response. -
Uses of Context in com.azure.core.http.rest
Modifier and TypeMethodDescriptionRequestOptions.getContext()
Gets the additional context on the request that is passed during the service call.Modifier and TypeMethodDescriptionRestProxy.send
(HttpRequest request, Context contextData) Send the provided request asynchronously, applying any request policies provided to the HttpClient instance.RequestOptions.setContext
(Context context) Sets the additional context on the request that is passed during the service call. -
Uses of Context in com.azure.core.tracing.opentelemetry
Modifier and TypeMethodDescriptionOpenTelemetryTracer.extractContext
(Function<String, String> headerGetter) Extracts the span's context asContext
from upstream.Creates a new tracing span.OpenTelemetryTracer.start
(String spanName, StartSpanOptions options, Context context) Creates a new tracing span.Modifier and TypeMethodDescriptionvoid
OpenTelemetryTracer.addEvent
(String eventName, Map<String, Object> traceEventAttributes, OffsetDateTime timestamp, Context context) Adds an event to the span present in theContext
with the providedtimestamp
andattributes
.void
Completes the current tracing span for AMQP calls.void
OpenTelemetryTracer.injectContext
(BiConsumer<String, String> headerSetter, Context context) OpenTelemetryTracer.makeSpanCurrent
(Context context) Makes span current.void
OpenTelemetryTracer.setAttribute
(String key, long value, Context context) void
OpenTelemetryTracer.setAttribute
(String key, String value, Context context) Adds metadata to the current span.Creates a new tracing span.OpenTelemetryTracer.start
(String spanName, StartSpanOptions options, Context context) Creates a new tracing span. -
Uses of Context in com.azure.core.util
Modifier and TypeFieldDescriptionstatic final Context
Context.NONE
Signifies that no data needs to be passed to the pipeline.Modifier and TypeMethodDescriptionContexts.getContext()
Returns a version of theContext
reflecting mutations.static Context
CoreUtils.mergeContexts
(Context into, Context from) static Context
Modifier and TypeMethodDescriptionstatic <T> org.reactivestreams.Publisher<T>
CoreUtils.extractAndFetch
(PagedResponse<T> page, Context context, BiFunction<String, Context, org.reactivestreams.Publisher<T>> content) Deprecated.Use localized implementation.static Context
CoreUtils.mergeContexts
(Context into, Context from) static Context
FluxUtil.toReactorContext
(Context context) Converts an Azure context to Reactor context.static Contexts
Modifier and TypeMethodDescriptionstatic <T> org.reactivestreams.Publisher<T>
CoreUtils.extractAndFetch
(PagedResponse<T> page, Context context, BiFunction<String, Context, org.reactivestreams.Publisher<T>> content) Deprecated.Use localized implementation.static <T> Flux<T>
FluxUtil.fluxContext
(Function<Context, Flux<T>> serviceCall) This method converts the incomingdeferContextual
fromReactor Context
toAzure Context
and calls the given lambda function with this context and returns a collection of typeT
static <T> Mono<T>
FluxUtil.withContext
(Function<Context, Mono<T>> serviceCall) This method converts the incomingdeferContextual
fromReactor Context
toAzure Context
and calls the given lambda function with this context and returns a single entity of typeT
static <T> Mono<T>
This method converts the incomingdeferContextual
fromReactor Context
toAzure Context
, adds the specified context attributes and calls the given lambda function with this context and returns a single entity of typeT
-
Uses of Context in com.azure.core.util.metrics
Modifier and TypeMethodDescriptionvoid
LongCounter.add
(long value, TelemetryAttributes attributes, Context context) Records a value with a set of attributes.void
DoubleHistogram.record
(double value, TelemetryAttributes attributes, Context context) Records a value with a set of attributes. -
Uses of Context in com.azure.core.util.polling
ModifierConstructorDescriptionDefaultPollingStrategy
(HttpPipeline httpPipeline, JsonSerializer serializer, Context context) Creates a chained polling strategy with 3 known polling strategies,OperationResourcePollingStrategy
,LocationPollingStrategy
, andStatusCheckPollingStrategy
, in this order, with a custom serializer.DefaultPollingStrategy
(HttpPipeline httpPipeline, String endpoint, JsonSerializer serializer, Context context) Creates a chained polling strategy with 3 known polling strategies,OperationResourcePollingStrategy
,LocationPollingStrategy
, andStatusCheckPollingStrategy
, in this order, with a custom serializer.LocationPollingStrategy
(HttpPipeline httpPipeline, ObjectSerializer serializer, Context context) Creates an instance of the location polling strategy.LocationPollingStrategy
(HttpPipeline httpPipeline, String endpoint, ObjectSerializer serializer, Context context) Creates an instance of the location polling strategy.OperationResourcePollingStrategy
(HttpPipeline httpPipeline, ObjectSerializer serializer, String operationLocationHeaderName, Context context) Creates an instance of the operation resource polling strategy.OperationResourcePollingStrategy
(HttpPipeline httpPipeline, String endpoint, ObjectSerializer serializer, String operationLocationHeaderName, Context context) Creates an instance of the operation resource polling strategy.SyncDefaultPollingStrategy
(HttpPipeline httpPipeline, JsonSerializer serializer, Context context) Creates a synchronous chained polling strategy with three known polling strategies,SyncOperationResourcePollingStrategy
,SyncLocationPollingStrategy
, andSyncStatusCheckPollingStrategy
, in this order, with a JSON serializer.SyncDefaultPollingStrategy
(HttpPipeline httpPipeline, String endpoint, JsonSerializer serializer, Context context) Creates a synchronous chained polling strategy with three known polling strategies,SyncOperationResourcePollingStrategy
,SyncLocationPollingStrategy
, andSyncStatusCheckPollingStrategy
, in this order, with a JSON serializer.SyncLocationPollingStrategy
(HttpPipeline httpPipeline, ObjectSerializer serializer, Context context) Creates an instance of the location polling strategy.SyncLocationPollingStrategy
(HttpPipeline httpPipeline, String endpoint, ObjectSerializer serializer, Context context) Creates an instance of the location polling strategy.SyncOperationResourcePollingStrategy
(HttpPipeline httpPipeline, ObjectSerializer serializer, String operationLocationHeaderName, Context context) Creates an instance of the operation resource polling strategy.SyncOperationResourcePollingStrategy
(HttpPipeline httpPipeline, String endpoint, ObjectSerializer serializer, String operationLocationHeaderName, Context context) Creates an instance of the operation resource polling strategy. -
Uses of Context in com.azure.core.util.tracing
Modifier and TypeMethodDescriptiondefault Context
Tracer.extractContext
(String diagnosticId, Context context) Deprecated.default Context
Tracer.extractContext
(Function<String, String> headerGetter) Extracts the span's context asContext
from upstream.TracingLink.getContext()
Gets linked contextStartSpanOptions.getRemoteParent()
Gets remote parent.default Context
Tracer.getSharedSpanBuilder
(String spanName, Context context) Deprecated.useStartSpanOptions.addLink(TracingLink)
insteaddefault Context
Tracer.setSpanName
(String spanName, Context context) Deprecated.not needed.static Context
TracerProxy.setSpanName
(String spanName, Context context) Deprecated.Sets the span name for eachtracer
plugged into the SDK.Creates a new tracing span.default Context
Tracer.start
(String spanName, Context context, ProcessKind processKind) Deprecated.useTracer.start(String, StartSpanOptions, Context)
instead.default Context
Tracer.start
(String methodName, StartSpanOptions options, Context context) Creates a new tracing span.static Context
Deprecated.A new tracing span with INTERNAL kind is created for eachtracer
plugged into the SDK.static Context
TracerProxy.start
(String methodName, StartSpanOptions spanOptions, Context context) Deprecated.A new tracing span is created for eachtracer
plugged into the SDK.Modifier and TypeMethodDescriptiondefault void
Tracer.addEvent
(String name, Map<String, Object> attributes, OffsetDateTime timestamp, Context context) Adds an event to the span present in theContext
with the providedtimestamp
andattributes
.default void
Deprecated.default void
Deprecated.set specific attribute e.g.void
Completes the current tracing span for AMQP calls.static void
Deprecated.For the plugged intracer
, its current tracing span is marked as completed.default Context
Tracer.extractContext
(String diagnosticId, Context context) Deprecated.default Context
Tracer.getSharedSpanBuilder
(String spanName, Context context) Deprecated.useStartSpanOptions.addLink(TracingLink)
insteaddefault void
Tracer.injectContext
(BiConsumer<String, String> headerSetter, Context context) Injects tracing context.default AutoCloseable
Tracer.makeSpanCurrent
(Context context) Makes span current.default void
Tracer.setAttribute
(String key, long value, Context context) Sets long attribute.void
Tracer.setAttribute
(String key, String value, Context context) Adds metadata to the current span.static void
TracerProxy.setAttribute
(String key, String value, Context context) Deprecated.For the plugged intracer
, the key-value pair metadata is added to its current span.StartSpanOptions.setRemoteParent
(Context parent) Sets remote parent context.default Context
Tracer.setSpanName
(String spanName, Context context) Deprecated.not needed.static Context
TracerProxy.setSpanName
(String spanName, Context context) Deprecated.Sets the span name for eachtracer
plugged into the SDK.Creates a new tracing span.default Context
Tracer.start
(String spanName, Context context, ProcessKind processKind) Deprecated.useTracer.start(String, StartSpanOptions, Context)
instead.default Context
Tracer.start
(String methodName, StartSpanOptions options, Context context) Creates a new tracing span.static Context
Deprecated.A new tracing span with INTERNAL kind is created for eachtracer
plugged into the SDK.static Context
TracerProxy.start
(String methodName, StartSpanOptions spanOptions, Context context) Deprecated.A new tracing span is created for eachtracer
plugged into the SDK.ModifierConstructorDescriptionTracingLink
(Context context) Creates link traces without attributesTracingLink
(Context context, Map<String, Object> attributes) Creates link with attributes.