Interface ProxyClient

All Known Implementing Classes:
LoadBalancingProxyClient, SimpleProxyClientProvider

public interface ProxyClient
A client that provides connections for the proxy handler. The provided connection is valid for the duration of the current exchange. Note that implementation are required to manage the lifecycle of these connections themselves, generally by registering callbacks on the exchange.
Author:
Stuart Douglas
  • Method Details

    • findTarget

      Finds a proxy target for this request, returning null if none can be found. If this method returns null it means that there is no backend available to handle this request, and it should proceed as normal.
      Parameters:
      exchange - The exchange
      Returns:
      The proxy target
    • getConnection

      void getConnection(ProxyClient.ProxyTarget target, HttpServerExchange exchange, ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit)
      Gets a proxy connection for the given request.
      Parameters:
      exchange - The exchange
      callback - The callback
      timeout - The timeout
      timeUnit - Time unit for the timeout
    • getAllTargets

      default List<ProxyClient.ProxyTarget> getAllTargets()