Package org.microproxy
Enum Class DrainStrategy
- All Implemented Interfaces:
Serializable,Comparable<DrainStrategy>,Constable
How a draining proxy (
HttpProxyServer.drain(java.time.Duration)) tells its clients to go elsewhere, as
Envoy's --drain-strategy: each new request may be answered with Connection:
close (HTTP/1) or make the proxy send GOAWAY (HTTP/2, HTTP/3) on its connection.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe chance that a request drains its connection grows from 0 at the start of the drain to 1 at its end, so clients move away gradually rather than all at once (the default).Every connection is told at once: idle ones are closed, busy ones close after their request in progress. -
Method Summary
Modifier and TypeMethodDescriptionstatic DrainStrategyThe strategy namedname, in any case.static DrainStrategyReturns the enum constant of this class with the specified name.static DrainStrategy[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
GRADUAL
The chance that a request drains its connection grows from 0 at the start of the drain to 1 at its end, so clients move away gradually rather than all at once (the default). -
IMMEDIATE
Every connection is told at once: idle ones are closed, busy ones close after their request in progress.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
parse
The strategy namedname, in any case.- Parameters:
name-gradualorimmediate- Returns:
- the strategy
- Throws:
IllegalArgumentException- for another name
-