public interface AsyncLoadBalancingHandler
AsyncLoadBalancingHandleris the runtime component of a
LoadBalancingStrategythat provides the logic for load balancing requests to
TargetHosts configured for a Site. Different from a
AsyncLoadBalancingHandlerapplies this logic asynchronously.
|Modifier and Type||Method and Description|
Calculate the target host, given the list of available hosts and the current exchange.
Updates any internal data based on the response and optionally updates the response.
CompletionStage<TargetHost> calculateTargetHost(Exchange exchange, List<TargetHost> availableHosts, List<TargetHost> configuredHosts)
TargetHostis detected as unavailable after it is selected. To store data in between invocations, use the
exchange- The exchange.
availableHosts- The list of available hosts for a Site. This list cannot be modified by implementations.
configuredHosts- The list of configured hosts for a Site. This can be used to determine which hosts for the Site are available and perform any necessary cleanup for this case. This list cannot be modified by implementations.
CompletionStagecontaining the target host or null if none could be determined. The behavior is undefined when the TargetHost returned is not an element of the availableHosts list.
CompletionStage<Void> handleResponse(Exchange exchange, TargetHost targetHost)
exchange- The exchange containing the response.
targetHost- The target host used for the request.
CompletionStagerepresenting the asynchronous completion of the method. If this method does not require use of a
HttpClient, the logic of the method can be performed synchronously and then return a completed
CompletionStagewith code like:
Copyright 2019 Ping Identity Corp. All rights reserved.