Interface BaseExchange<A extends ExchangeContext,B,C>

Type Parameters:
A - The exchange context type
B - The request type
C - The response type

public interface BaseExchange<A extends ExchangeContext,B,C>

Base HTTP exchange (request/response) for representing server or client exchanges.

An HTTP exchange basically comes down to a request and a response being exchanged between a client and a server. In a client exchange, the client sends the request to the server and receives the response from the server. In a server exchange, the server receives the request from the client and sends the response to the client.

A context is also attached to every exchange to provide contextual data and operation during during the processing of the exchange.

Since:
1.6
Author:
Jeremy Kuhn
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the context attached to the exchange.
    Returns the protocol of the exchange (eg.
    Returns the request part of the exchange.
    Returns the response part of the exchange.
  • Method Details

    • getProtocol

      HttpVersion getProtocol()

      Returns the protocol of the exchange (eg. HTTP/1.1).

      Returns:
      the protocol
    • context

      A context()

      Returns the context attached to the exchange.

      Returns:
      the exchange context or null
    • request

      B request()

      Returns the request part of the exchange.

      Returns:
      the request part
    • response

      C response()

      Returns the response part of the exchange.

      Returns:
      the response part