Interface HttpTransport

All Known Implementing Classes:
HttpConnection, HttpTransportOverFCGI, HttpTransportOverHTTP2

public interface HttpTransport
Abstraction of the outbound HTTP transport.
  • Field Details

    • UPGRADE_CONNECTION_ATTRIBUTE

      static final String UPGRADE_CONNECTION_ATTRIBUTE
  • Method Details

    • send

      void send(MetaData.Request request, MetaData.Response response, ByteBuffer content, boolean lastContent, Callback callback)
      Asynchronous call to send a response (or part) over the transport
      Parameters:
      request - True if the response if for a HEAD request (and the data should not be sent).
      response - The header info to send, or null if just sending more data. The first call to send for a response must have a non null info.
      content - A buffer of content to be sent.
      lastContent - True if the content is the last content for the current response.
      callback - The Callback instance that success or failure of the send is notified on
    • isPushSupported

      boolean isPushSupported()
      Returns:
      true if responses can be pushed over this transport
    • push

      void push(MetaData.Request request)
      Parameters:
      request - A request to use as the basis for generating a pushed response.
    • onCompleted

      void onCompleted()
      Called to indicated the end of the current request/response cycle (which may be some time after the last content is sent).
    • abort

      void abort(Throwable failure)
      Aborts this transport.

      This method should terminate the transport in a way that can indicate an abnormal response to the client, for example by abruptly close the connection.

      This method is called when an error response needs to be sent, but the response is already committed, or when a write failure is detected. If abort is called, onCompleted() is not called

      Parameters:
      failure - the failure that caused the abort.