Class PowerOfTwoChoicesConfiguration
- java.lang.Object
-
- io.smallrye.stork.loadbalancer.poweroftwochoices.PowerOfTwoChoicesConfiguration
-
- All Implemented Interfaces:
ConfigWithType
public class PowerOfTwoChoicesConfiguration extends Object implements ConfigWithType
Configuration for thePowerOfTwoChoicesLoadBalancerProviderLoadBalancer.
-
-
Constructor Summary
Constructors Constructor Description PowerOfTwoChoicesConfiguration()Creates a new PowerOfTwoChoicesConfigurationPowerOfTwoChoicesConfiguration(Map<String,String> params)Creates a new PowerOfTwoChoicesConfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetUseSecureRandom()Whether the load balancer should use a SecureRandom instead of a Random (default).Map<String,String>parameters()Stringtype()PowerOfTwoChoicesConfigurationwithUseSecureRandom(String value)Set the 'use-secure-random' attribute.
-
-
-
Constructor Detail
-
PowerOfTwoChoicesConfiguration
public PowerOfTwoChoicesConfiguration(Map<String,String> params)
Creates a new PowerOfTwoChoicesConfiguration- Parameters:
params- the parameters, must not benull
-
PowerOfTwoChoicesConfiguration
public PowerOfTwoChoicesConfiguration()
Creates a new PowerOfTwoChoicesConfiguration
-
-
Method Detail
-
type
public String type()
- Specified by:
typein interfaceConfigWithType- Returns:
- the type
-
parameters
public Map<String,String> parameters()
- Specified by:
parametersin interfaceConfigWithType- Returns:
- the parameters
-
getUseSecureRandom
public String getUseSecureRandom()
Whether the load balancer should use a SecureRandom instead of a Random (default). Check [this page](https://stackoverflow.com/questions/11051205/difference-between-java-util-random-and-java-security-securerandom) to understand the difference By default: false- Returns:
- the configured use-secure-random,
falseif not set
-
withUseSecureRandom
public PowerOfTwoChoicesConfiguration withUseSecureRandom(String value)
Set the 'use-secure-random' attribute. Default is false.- Parameters:
value- the value for use-secure-random- Returns:
- the current PowerOfTwoChoicesConfiguration to chain calls
-
-