Package org.microproxy
Enum Class ServerState
- All Implemented Interfaces:
Serializable,Comparable<ServerState>,Constable
Where a proxy is in its life (
HttpProxyServer.state()), with the names Envoy's admin
/ready answers and the numbers its server.state gauge shows. A proxy goes from
INITIALIZING to LIVE as it starts, to DRAINING when it is drained or
stops accepting, and to STOPPED once it has stopped.-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionDraining (HttpProxyServer.drain(java.time.Duration)), no longer accepting (HttpProxyServer.stopListeners()), or stopping: not ready for new traffic.Starting: the admin listener may answer while the proxy's own listeners are being bound.Serving: accepting connections and requests.Made, not started yet.Stopped: every listener and connection closed. -
Method Summary
Modifier and TypeMethodDescriptionintcode()Returns the value of theserver.stategauge in this state, Envoy's number for it.static ServerStateReturns the enum constant of this class with the specified name.static ServerState[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LIVE
Serving: accepting connections and requests.server.state0. -
DRAINING
Draining (HttpProxyServer.drain(java.time.Duration)), no longer accepting (HttpProxyServer.stopListeners()), or stopping: not ready for new traffic.server.state1. -
PRE_INITIALIZING
Made, not started yet.server.state2. -
INITIALIZING
Starting: the admin listener may answer while the proxy's own listeners are being bound.server.state3. -
STOPPED
Stopped: every listener and connection closed.server.state4, MicroProxy's own (Envoy has no such state).
-
-
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
-
code
public int code()Returns the value of theserver.stategauge in this state, Envoy's number for it.- Returns:
- the value of the
server.stategauge in this state, Envoy's number for it
-