azure-docs-sdk-java/docs-ref-autogen/com.azure.core.http.policy....

79 строки
8.0 KiB
YAML

### YamlMime:JavaType
uid: "com.azure.core.http.policy.RequestIdPolicy"
fullName: "com.azure.core.http.policy.RequestIdPolicy"
name: "RequestIdPolicy"
nameWithType: "RequestIdPolicy"
summary: "The `RequestIdPolicy` class is an implementation of the <xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipelinePolicy\"></xref> interface."
inheritances:
- "<xref href=\"java.lang.Object?displayProperty=fullName\" data-throw-if-not-resolved=\"False\" />"
inheritedClassMethods:
- classRef: "java.lang.<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html\">Object</a>"
methodsRef:
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#clone--\">clone</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#equals-java.lang.Object-\">equals</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#finalize--\">finalize</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#getClass--\">getClass</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#hashCode--\">hashCode</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notify--\">notify</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#notifyAll--\">notifyAll</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#toString--\">toString</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait--\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-\">wait</a>"
- "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/Object.html#wait-long-int-\">wait</a>"
syntax: "public class **RequestIdPolicy**</br> implements <xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
constructors:
- uid: "com.azure.core.http.policy.RequestIdPolicy.RequestIdPolicy()"
fullName: "com.azure.core.http.policy.RequestIdPolicy.RequestIdPolicy()"
name: "RequestIdPolicy()"
nameWithType: "RequestIdPolicy.RequestIdPolicy()"
summary: "Creates default <xref uid=\"com.azure.core.http.policy.RequestIdPolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RequestIdPolicy\"></xref> with default header name 'x-ms-client-request-id'."
syntax: "public RequestIdPolicy()"
desc: "Creates default <xref uid=\"com.azure.core.http.policy.RequestIdPolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RequestIdPolicy\"></xref> with default header name 'x-ms-client-request-id'."
- uid: "com.azure.core.http.policy.RequestIdPolicy.RequestIdPolicy(java.lang.String)"
fullName: "com.azure.core.http.policy.RequestIdPolicy.RequestIdPolicy(String requestIdHeaderName)"
name: "RequestIdPolicy(String requestIdHeaderName)"
nameWithType: "RequestIdPolicy.RequestIdPolicy(String requestIdHeaderName)"
summary: "Creates <xref uid=\"com.azure.core.http.policy.RequestIdPolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RequestIdPolicy\"></xref> with provided `requestIdHeaderName`."
parameters:
- description: "to be used to set in <xref uid=\"com.azure.core.http.HttpRequest\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequest\"></xref>."
name: "requestIdHeaderName"
type: "<a href=\"https://docs.oracle.com/javase/8/docs/api/java/lang/String.html\">String</a>"
syntax: "public RequestIdPolicy(String requestIdHeaderName)"
desc: "Creates <xref uid=\"com.azure.core.http.policy.RequestIdPolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"RequestIdPolicy\"></xref> with provided `requestIdHeaderName`."
methods:
- uid: "com.azure.core.http.policy.RequestIdPolicy.process(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextPolicy)"
fullName: "com.azure.core.http.policy.RequestIdPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
name: "process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
nameWithType: "RequestIdPolicy.process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
summary: "Processes provided request context and invokes the next policy."
parameters:
- name: "context"
type: "<xref href=\"com.azure.core.http.HttpPipelineCallContext?alt=com.azure.core.http.HttpPipelineCallContext&text=HttpPipelineCallContext\" data-throw-if-not-resolved=\"False\" />"
- name: "next"
type: "<xref href=\"com.azure.core.http.HttpPipelineNextPolicy?alt=com.azure.core.http.HttpPipelineNextPolicy&text=HttpPipelineNextPolicy\" data-throw-if-not-resolved=\"False\" />"
syntax: "public Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)"
desc: "Processes provided request context and invokes the next policy."
returns:
type: "<a href=\"https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Mono.html\">Mono</a>&lt;<xref href=\"com.azure.core.http.HttpResponse?alt=com.azure.core.http.HttpResponse&text=HttpResponse\" data-throw-if-not-resolved=\"False\" />&gt;"
- uid: "com.azure.core.http.policy.RequestIdPolicy.processSync(com.azure.core.http.HttpPipelineCallContext,com.azure.core.http.HttpPipelineNextSyncPolicy)"
fullName: "com.azure.core.http.policy.RequestIdPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
name: "processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
nameWithType: "RequestIdPolicy.processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
summary: "Processes provided request context and invokes the next policy synchronously."
parameters:
- name: "context"
type: "<xref href=\"com.azure.core.http.HttpPipelineCallContext?alt=com.azure.core.http.HttpPipelineCallContext&text=HttpPipelineCallContext\" data-throw-if-not-resolved=\"False\" />"
- name: "next"
type: "<xref href=\"com.azure.core.http.HttpPipelineNextSyncPolicy?alt=com.azure.core.http.HttpPipelineNextSyncPolicy&text=HttpPipelineNextSyncPolicy\" data-throw-if-not-resolved=\"False\" />"
syntax: "public HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)"
desc: "Processes provided request context and invokes the next policy synchronously."
returns:
type: "<xref href=\"com.azure.core.http.HttpResponse?alt=com.azure.core.http.HttpResponse&text=HttpResponse\" data-throw-if-not-resolved=\"False\" />"
type: "class"
desc: "The `RequestIdPolicy` class is an implementation of the <xref uid=\"com.azure.core.http.policy.HttpPipelinePolicy\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpPipelinePolicy\"></xref> interface. This policy is used to add a unique identifier to each <xref uid=\"com.azure.core.http.HttpRequest\" data-throw-if-not-resolved=\"false\" data-raw-source=\"HttpRequest\"></xref> in the form of a UUID in the request header. Azure uses the request id as the unique identifier for the request.\n\nThis class is useful when you need to track HTTP requests for debugging or auditing purposes. It allows you to specify a custom header name for the request id, or use the default header name 'x-ms-client-request-id'.\n\n**Code sample:**\n\nIn this example, a `RequestIdPolicy` is created with a custom header name. Once added to the pipeline requests will have their request id set in the 'x-ms-my-custom-request-id' header by the `RequestIdPolicy`.\n\n```java\n// Using the default header name\n RequestIdPolicy defaultPolicy = new RequestIdPolicy();\n // Using a custom header name\n RequestIdPolicy customRequestIdPolicy = new RequestIdPolicy(\"x-ms-my-custom-request-id\");\n```"
implements:
- "<xref href=\"com.azure.core.http.policy.HttpPipelinePolicy?alt=com.azure.core.http.policy.HttpPipelinePolicy&text=HttpPipelinePolicy\" data-throw-if-not-resolved=\"False\" />"
metadata: {}
package: "com.azure.core.http.policy"
artifact: com.azure:azure-core:1.52.0