Class HttpPipelineSyncPolicy

java.lang.Object
com.azure.core.http.policy.HttpPipelineSyncPolicy
All Implemented Interfaces:
HttpPipelinePolicy

public class HttpPipelineSyncPolicy extends Object implements HttpPipelinePolicy
The HttpPipelineSyncPolicy class is an implementation of the HttpPipelinePolicy interface. This policy represents a synchronous operation within the HTTP pipeline, meaning it doesn't perform any asynchronous or synchronously blocking operations.

This class is useful when you need to perform operations in the HTTP pipeline that don't require asynchronous processing or blocking. It provides hooks to perform actions before the request is sent and after the response is received.

See Also:
  • Constructor Details

  • Method Details

    • process

      public final Mono<HttpResponse> process(HttpPipelineCallContext context, HttpPipelineNextPolicy next)
      Processes provided request context and invokes the next policy.
      Specified by:
      process in interface HttpPipelinePolicy
      Parameters:
      context - The request context.
      next - The next policy to invoke.
      Returns:
      A publisher that initiates the request upon subscription and emits a response on completion.
    • processSync

      public final HttpResponse processSync(HttpPipelineCallContext context, HttpPipelineNextSyncPolicy next)
      Processes provided request context and invokes the next policy synchronously.
      Specified by:
      processSync in interface HttpPipelinePolicy
      Parameters:
      context - The request context.
      next - The next policy to invoke.
      Returns:
      A publisher that initiates the request upon subscription and emits a response on completion.
    • beforeSendingRequest

      protected void beforeSendingRequest(HttpPipelineCallContext context)
      Method is invoked before the request is sent.
      Parameters:
      context - The request context.
    • afterReceivedResponse

      protected HttpResponse afterReceivedResponse(HttpPipelineCallContext context, HttpResponse response)
      Method is invoked after the response is received.
      Parameters:
      context - The request context.
      response - The response received.
      Returns:
      The transformed response.