java.lang.Object
java.lang.Enum<TunnelTestStatus>
net.i2p.router.TunnelTestStatus
All Implemented Interfaces:
Serializable, Comparable<TunnelTestStatus>, java.lang.constant.Constable

public enum TunnelTestStatusextends Enum<TunnelTestStatus>
Test status for tunnel testing display.
  • Enum Constant Details

    • UNTESTED

      public static final TunnelTestStatus UNTESTED
      No test has been run yet.
    • TESTING

      public static final TunnelTestStatus TESTING
      Test is currently in progress.
    • GOOD

      public static final TunnelTestStatus GOOD
      Recent successful test.
    • FAILING

      public static final TunnelTestStatus FAILING
      One or two consecutive failures.
    • FAILED

      public static final TunnelTestStatus FAILED
      Three consecutive failures, marked for removal.
    • TOO_SLOW

      public static final TunnelTestStatus TOO_SLOW
      Scheduled for early expiry due to slow tunnel.
    • OVER_BUDGET

      public static final TunnelTestStatus OVER_BUDGET
      Scheduled for early expiry due to pool over budget.
  • Constructor Details

    • TunnelTestStatus

      private TunnelTestStatus()
  • Method Details

    • values

      public static TunnelTestStatus[] 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 TunnelTestStatus 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
    • isDead

      public boolean isDead()
      Whether this status marks the tunnel dead: three or more consecutive test failures, i.e. MAX_CONSECUTIVE_TEST_FAILURES. A dead tunnel is not capacity, is not offered as an endpoint, and is not rehabilitated by a traffic stamp — only a real passing test or a rebuild returns it to GOOD.
      Returns:
      true only for FAILED
    • isFailing

      public boolean isFailing()
      Whether this status marks a transient failure: one or two consecutive test failures. A failing tunnel is degraded but may recover, so it is rehabilitated to GOOD by either a passing test or a traffic stamp within TRAFFIC_PROOF_MS.
      Returns:
      true only for FAILING
    • isUnusable

      public boolean isUnusable()
      Whether a tunnel in this status must be withheld from healthy capacity counts and from endpoint selection.

      Defined here rather than at each call site because the counting and selection paths previously disagreed: the scan gates excluded both FAILED and FAILING while the usable-count helpers excluded only FAILING, so a pool holding nothing but dead tunnels still reported full capacity and suppressed its own pre-build. Callers that need a narrower rule should ask isDead() or isFailing() directly.

      Returns:
      true for FAILED and FAILING