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 ClassesModifier and TypeInterfaceDescriptionstatic interface
static interface
static interface
An opaque interface that may contain information about the proxy target -
Method Summary
Modifier and TypeMethodDescriptionfindTarget
(HttpServerExchange exchange) Finds a proxy target for this request, returning null if none can be found.default List<ProxyClient.ProxyTarget>
void
getConnection
(ProxyClient.ProxyTarget target, HttpServerExchange exchange, ProxyCallback<ProxyConnection> callback, long timeout, TimeUnit timeUnit) Gets a proxy connection for the given request.
-
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 exchangecallback
- The callbacktimeout
- The timeouttimeUnit
- Time unit for the timeout
-
getAllTargets
-