org.apache.hc.core5.http.nio

## Interface AsyncClientExchangeHandler

- All Superinterfaces:
    AsyncDataConsumer, AsyncDataExchangeHandler, AsyncDataProducer, ResourceHolder
  All Known Implementing Classes:
    BasicClientExchangeHandler

      public interface AsyncClientExchangeHandler
      extends AsyncDataExchangeHandler

  Abstract asynchronous client side message exchange handler that acts as a request producer and a response consumer.
  Since:
    5.0

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `cancel()` Triggered to cancel the message exchange.
    `void` | `consumeInformation(HttpResponse response, HttpContext context)` Triggered to signal receipt of an intermediate (1xx) HTTP response.
    `void` | `consumeResponse(HttpResponse response, EntityDetails entityDetails, HttpContext context)` Triggered to signal receipt of a response message head.
    `void` | `produceRequest(RequestChannel channel, HttpContext context)` Triggered to signal the ability of the underlying request channel to accept a request messages.

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataExchangeHandler

      `failed`

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataConsumer

      `consume, streamEnd, updateCapacity`

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.AsyncDataProducer

      `available, produce`

    - ### Methods inherited from interface org.apache.hc.core5.http.nio.ResourceHolder

      `releaseResources`

- - ### Method Detail

    - #### produceRequest

          void produceRequest(RequestChannel channel,
                              HttpContext context)
                       throws HttpException,
                              IOException

      Triggered to signal the ability of the underlying request channel to accept a request messages. The data producer can choose to send a request message immediately inside the call or asynchronously at some later point.
      Parameters:
        `channel` - the request channel capable to accepting a request message.
        `context` - the actual execution context.
      Throws:
        `HttpException` - in case of an HTTP protocol violation.
        `IOException` - in case of an I/O error.

    - #### consumeResponse

          void consumeResponse(HttpResponse response,
                               EntityDetails entityDetails,
                               HttpContext context)
                        throws HttpException,
                               IOException

      Triggered to signal receipt of a response message head.
      Parameters:
        `response` - the response message head.
        `entityDetails` - the response entity details or `null` if the response does not enclose an entity.
        `context` - the actual execution context.
      Throws:
        `HttpException` - in case of an HTTP protocol violation.
        `IOException` - in case of an I/O error.

    - #### consumeInformation

          void consumeInformation(HttpResponse response,
                                  HttpContext context)
                           throws HttpException,
                                  IOException

      Triggered to signal receipt of an intermediate (1xx) HTTP response.
      Parameters:
        `response` - the intermediate (1xx) HTTP response.
        `context` - the actual execution context.
      Throws:
        `HttpException` - in case of an HTTP protocol violation.
        `IOException` - in case of an I/O error.

    - #### cancel

          void cancel()

      Triggered to cancel the message exchange.

Copyright © 2005–2021 The Apache Software Foundation. All rights reserved.