Enum Class ServerState

java.lang.Object
java.lang.Enum<ServerState>
org.microproxy.ServerState
All Implemented Interfaces:
Serializable, Comparable<ServerState>, Constable

public enum ServerState extends Enum<ServerState>
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.
  • Enum Constant Details

    • LIVE

      public static final ServerState LIVE
      Serving: accepting connections and requests. server.state 0.
    • DRAINING

      public static final ServerState DRAINING
      Draining (HttpProxyServer.drain(java.time.Duration)), no longer accepting (HttpProxyServer.stopListeners()), or stopping: not ready for new traffic. server.state 1.
    • PRE_INITIALIZING

      public static final ServerState PRE_INITIALIZING
      Made, not started yet. server.state 2.
    • INITIALIZING

      public static final ServerState INITIALIZING
      Starting: the admin listener may answer while the proxy's own listeners are being bound. server.state 3.
    • STOPPED

      public static final ServerState STOPPED
      Stopped: every listener and connection closed. server.state 4, MicroProxy's own (Envoy has no such state).
  • Method Details

    • values

      public static ServerState[] 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

      public static ServerState valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • code

      public int code()
      Returns the value of the server.state gauge in this state, Envoy's number for it.
      Returns:
      the value of the server.state gauge in this state, Envoy's number for it