org.apache.hc.client5.testing.async

## Class ServiceUnavailableAsyncDecorator

- java.lang.Object
- - org.apache.hc.client5.testing.async.ServiceUnavailableAsyncDecorator

- All Implemented Interfaces:
    org.apache.hc.core5.http.nio.AsyncDataConsumer, org.apache.hc.core5.http.nio.AsyncDataExchangeHandler, org.apache.hc.core5.http.nio.AsyncDataProducer, org.apache.hc.core5.http.nio.AsyncServerExchangeHandler, org.apache.hc.core5.http.nio.ResourceHolder

      public class ServiceUnavailableAsyncDecorator
      extends Object
      implements org.apache.hc.core5.http.nio.AsyncServerExchangeHandler

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServiceUnavailableAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler, org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpRequest,org.apache.hc.core5.util.TimeValue> serviceAvailabilityResolver)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `available()`
    `void` | `consume(ByteBuffer src)`
    `void` | `failed(Exception cause)`
    `void` | `handleRequest(org.apache.hc.core5.http.HttpRequest request, org.apache.hc.core5.http.EntityDetails entityDetails, org.apache.hc.core5.http.nio.ResponseChannel responseChannel, org.apache.hc.core5.http.protocol.HttpContext context)`
    `void` | `produce(org.apache.hc.core5.http.nio.DataStreamChannel channel)`
    `void` | `releaseResources()`
    `void` | `streamEnd(List<? extends org.apache.hc.core5.http.Header> trailers)`
    `void` | `updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel)`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### ServiceUnavailableAsyncDecorator

          public ServiceUnavailableAsyncDecorator(org.apache.hc.core5.http.nio.AsyncServerExchangeHandler exchangeHandler,
                                          org.apache.hc.core5.function.Resolver<org.apache.hc.core5.http.HttpRequest,org.apache.hc.core5.util.TimeValue> serviceAvailabilityResolver)

  - ### Method Detail

    - #### handleRequest

          public void handleRequest(org.apache.hc.core5.http.HttpRequest request,
                           org.apache.hc.core5.http.EntityDetails entityDetails,
                           org.apache.hc.core5.http.nio.ResponseChannel responseChannel,
                           org.apache.hc.core5.http.protocol.HttpContext context)
                             throws org.apache.hc.core5.http.HttpException,
                                    IOException

      Specified by:
        `handleRequest` in interface `org.apache.hc.core5.http.nio.AsyncServerExchangeHandler`
      Throws:
        `org.apache.hc.core5.http.HttpException`
        `IOException`

    - #### updateCapacity

          public final void updateCapacity(org.apache.hc.core5.http.nio.CapacityChannel capacityChannel)
                                    throws IOException

      Specified by:
        `updateCapacity` in interface `org.apache.hc.core5.http.nio.AsyncDataConsumer`
      Throws:
        `IOException`

    - #### consume

          public final void consume(ByteBuffer src)
                             throws IOException

      Specified by:
        `consume` in interface `org.apache.hc.core5.http.nio.AsyncDataConsumer`
      Throws:
        `IOException`

    - #### streamEnd

          public final void streamEnd(List<? extends org.apache.hc.core5.http.Header> trailers)
                               throws org.apache.hc.core5.http.HttpException,
                                      IOException

      Specified by:
        `streamEnd` in interface `org.apache.hc.core5.http.nio.AsyncDataConsumer`
      Throws:
        `org.apache.hc.core5.http.HttpException`
        `IOException`

    - #### available

          public int available()

      Specified by:
        `available` in interface `org.apache.hc.core5.http.nio.AsyncDataProducer`

    - #### produce

          public void produce(org.apache.hc.core5.http.nio.DataStreamChannel channel)
                       throws IOException

      Specified by:
        `produce` in interface `org.apache.hc.core5.http.nio.AsyncDataProducer`
      Throws:
        `IOException`

    - #### failed

          public void failed(Exception cause)

      Specified by:
        `failed` in interface `org.apache.hc.core5.http.nio.AsyncDataExchangeHandler`

    - #### releaseResources

          public void releaseResources()

      Specified by:
        `releaseResources` in interface `org.apache.hc.core5.http.nio.ResourceHolder`

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.