Package io.inverno.mod.discovery.http
Class HttpTrafficPolicy.Builder
java.lang.Object
io.inverno.mod.discovery.http.HttpTrafficPolicy.Builder
- Enclosing class:
HttpTrafficPolicy
An HTTP traffic policy builder.
- Since:
- 1.12
- Author:
- Jeremy Kuhn
-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds and returns the HTTP traffic policy.configuration(HttpClientConfiguration configuration) Sets the HTTP client configuration.Sets theLeastRequestTrafficLoadBalancerfactory.leastRequestLoadBalancer(int choiceCount, int bias) Sets theLeastRequestTrafficLoadBalancerfactory.Sets the load balancer factory corresponding to the specified strategy.Sets theMinLoadFactorTrafficLoadBalancerfactory.minLoadFactorLoadBalancer(int choiceCount, int bias) Sets theMinLoadFactorTrafficLoadBalancerfactory.netConfiguration(NetClientConfiguration netConfiguration) Sets the Net client configuration.Sets theRandomTrafficLoadBalancerfactory.Sets theRoundRobinTrafficLoadBalancerfactory.
-
Method Details
-
configuration
Sets the HTTP client configuration.
- Parameters:
configuration- an HTTP client configuration- Returns:
- the builder
-
netConfiguration
Sets the Net client configuration.
- Parameters:
netConfiguration- an Net client configuration- Returns:
- the builder
-
loadBalancer
Sets the load balancer factory corresponding to the specified strategy.
- Parameters:
strategy- a load balancing strategy- Returns:
- the builder
-
randomLoadBalancer
Sets the
RandomTrafficLoadBalancerfactory.- Returns:
- the builder
-
roundRobinLoadBalancer
Sets the
RoundRobinTrafficLoadBalancerfactory.- Returns:
- the builder
-
leastRequestLoadBalancer
Sets the
LeastRequestTrafficLoadBalancerfactory.- Returns:
- the builder
-
leastRequestLoadBalancer
Sets the
LeastRequestTrafficLoadBalancerfactory.- Parameters:
choiceCount- the choice countbias- the active requests bias- Returns:
- the builder
-
minLoadFactorLoadBalancer
Sets the
MinLoadFactorTrafficLoadBalancerfactory.- Returns:
- the builder
-
minLoadFactorLoadBalancer
Sets the
MinLoadFactorTrafficLoadBalancerfactory.- Parameters:
choiceCount- the choice countbias- the load factor bias- Returns:
- the builder
-
build
Builds and returns the HTTP traffic policy.
- Returns:
- an HTTP traffic policy
-