org.apache.hc.client5.http.io

## Class ConnectionEndpoint

- java.lang.Object
- - org.apache.hc.client5.http.io.ConnectionEndpoint

- All Implemented Interfaces:
    Closeable, AutoCloseable, ModalCloseable

      @Contract(threading=SAFE)
      public abstract class ConnectionEndpoint
      extends Object
      implements ModalCloseable

  Client endpoint leased from a connection manager. Client points can be used to execute HTTP requests.

  Once the endpoint is no longer needed it MUST be released with `ModalCloseable.close(org.apache.hc.core5.io.CloseMode)` )}.

  Since:
    5.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ConnectionEndpoint()`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract ClassicHttpResponse` | `execute(String id, ClassicHttpRequest request, HttpRequestExecutor executor, HttpContext context)` Executes HTTP request using the provided request executor.
    `abstract boolean` | `isConnected()` Determines if the connection to the remote endpoint is still open and valid.
    `abstract void` | `setSocketTimeout(Timeout timeout)` Sets the socket timeout value.

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

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

    - ### Methods inherited from interface org.apache.hc.core5.io.ModalCloseable

      `close`

    - ### Methods inherited from interface java.io.Closeable

      `close`

- - ### Constructor Detail

    - #### ConnectionEndpoint

          public ConnectionEndpoint()

  - ### Method Detail

    - #### execute

          public abstract ClassicHttpResponse execute(String id,
                                                      ClassicHttpRequest request,
                                                      HttpRequestExecutor executor,
                                                      HttpContext context)
                                               throws IOException,
                                                      HttpException

      Executes HTTP request using the provided request executor.

      Once the endpoint is no longer needed it MUST be released with `ModalCloseable.close(org.apache.hc.core5.io.CloseMode)`.

      Parameters:
        `id` - unique operation ID or `null`.
        `request` - the request message.
        `executor` - the request executor.
        `context` - the execution context.
      Throws:
        `IOException`
        `HttpException`

    - #### isConnected

          public abstract boolean isConnected()

      Determines if the connection to the remote endpoint is still open and valid.

    - #### setSocketTimeout

          public abstract void setSocketTimeout(Timeout timeout)

      Sets the socket timeout value.
      Parameters:
        `timeout` - timeout value

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