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 theLeastRequestTrafficLoadBalancer
factory.leastRequestLoadBalancer
(int choiceCount, int bias) Sets theLeastRequestTrafficLoadBalancer
factory.Sets the load balancer factory corresponding to the specified strategy.Sets theMinLoadFactorTrafficLoadBalancer
factory.minLoadFactorLoadBalancer
(int choiceCount, int bias) Sets theMinLoadFactorTrafficLoadBalancer
factory.netConfiguration
(NetClientConfiguration netConfiguration) Sets the Net client configuration.Sets theRandomTrafficLoadBalancer
factory.Sets theRoundRobinTrafficLoadBalancer
factory.
-
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
RandomTrafficLoadBalancer
factory.- Returns:
- the builder
-
roundRobinLoadBalancer
Sets the
RoundRobinTrafficLoadBalancer
factory.- Returns:
- the builder
-
leastRequestLoadBalancer
Sets the
LeastRequestTrafficLoadBalancer
factory.- Returns:
- the builder
-
leastRequestLoadBalancer
Sets the
LeastRequestTrafficLoadBalancer
factory.- Parameters:
choiceCount
- the choice countbias
- the active requests bias- Returns:
- the builder
-
minLoadFactorLoadBalancer
Sets the
MinLoadFactorTrafficLoadBalancer
factory.- Returns:
- the builder
-
minLoadFactorLoadBalancer
Sets the
MinLoadFactorTrafficLoadBalancer
factory.- 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
-