io.undertow.server.handlers.proxy

## 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

### Nested Class Summary

Nested Classes
`static interface` `ProxyClient.HostProxyTarget`
`static interface` `ProxyClient.MaxRetriesProxyTarget`
`static interface` `ProxyClient.ProxyTarget` An opaque interface that may contain information about the proxy target

### Method Summary

All Methods Instance Methods Abstract Methods Default Methods
`ProxyClient.ProxyTarget` `findTarget(HttpServerExchange exchange)` Finds a proxy target for this request, returning null if none can be found.
`default List<ProxyClient.ProxyTarget>` `getAllTargets()`
`void` `getConnection(ProxyClient.ProxyTarget target, HttpServerExchange exchange, ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit)` Gets a proxy connection for the given request.

### Method Detail

#### findTarget

    ProxyClient.ProxyTarget findTarget(HttpServerExchange exchange)

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()