Enum Class AdapterState

java.lang.Object
java.lang.Enum<AdapterState>
app.l2nx.gs.adapter.core.AdapterState
All Implemented Interfaces:
Serializable, Comparable<AdapterState>, Constable

public enum AdapterState extends Enum<AdapterState>
Lifecycle states observable via NxAdapter.state() / NxAdapter.onStateChange(java.util.function.Consumer<app.l2nx.gs.adapter.core.AdapterState>).

Transitions are atomic; observers see each state at most once per logical transition. Terminal states (FAILED, REJECTED, CLOSED) never re-enter the connect / heartbeat loop.

  • Enum Constant Details

    • INIT

      public static final AdapterState INIT
      Initial state before NxAdapter.start() runs.
    • REGISTERING

      public static final AdapterState REGISTERING
      Connect attempt in flight (first attempt, or any retry).
    • ACTIVE

      public static final AdapterState ACTIVE
      Connected, heartbeat running.
    • DEGRADED

      public static final AdapterState DEGRADED
      Transient failure (5xx / 409 / network) — retry scheduled.
    • FAILED

      public static final AdapterState FAILED
      Terminal failure due to config error or 401 (invalid server-key).
    • REJECTED

      public static final AdapterState REJECTED
      Terminal — server deactivated by tenant (403 GAME_SERVER_DEACTIVATED).
    • DISABLED

      public static final AdapterState DISABLED
      Adapter is loaded but l2nx.enabled=false — no work performed.
    • CLOSED

      public static final AdapterState CLOSED
      Terminal — JVM shutdown hook fired or NxAdapter.shutdown() called.
  • Method Details

    • values

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