Module bus.http

Enum Class Http2ErrorCode

java.lang.Object
java.lang.Enum<Http2ErrorCode>
org.miaixz.bus.http.metric.http.Http2ErrorCode
All Implemented Interfaces:
Serializable, Comparable<Http2ErrorCode>, Constable

public enum Http2ErrorCode extends Enum<Http2ErrorCode>
Represents an HTTP/2 error code, as defined in RFC 7540, Section 7.
Since:
Java 17+
Author:
Kimi Liu
  • Enum Constant Details

    • NO_ERROR

      public static final Http2ErrorCode NO_ERROR
      The associated condition is not a result of an error.
    • PROTOCOL_ERROR

      public static final Http2ErrorCode PROTOCOL_ERROR
      The endpoint detected an unspecific protocol error.
    • INTERNAL_ERROR

      public static final Http2ErrorCode INTERNAL_ERROR
      The endpoint encountered an unexpected internal error.
    • FLOW_CONTROL_ERROR

      public static final Http2ErrorCode FLOW_CONTROL_ERROR
      The endpoint detected that its peer violated the flow-control protocol.
    • REFUSED_STREAM

      public static final Http2ErrorCode REFUSED_STREAM
      The endpoint refuses the stream prior to processing any application logic.
    • CANCEL

      public static final Http2ErrorCode CANCEL
      The stream is no longer needed.
    • COMPRESSION_ERROR

      public static final Http2ErrorCode COMPRESSION_ERROR
      The endpoint is unable to maintain the header compression context for the connection.
    • CONNECT_ERROR

      public static final Http2ErrorCode CONNECT_ERROR
      The connection established in response to a CONNECT request was reset or abnormally closed.
    • ENHANCE_YOUR_CALM

      public static final Http2ErrorCode ENHANCE_YOUR_CALM
      The endpoint detected that its peer is exhibiting a behavior that might be generating excessive load.
    • INADEQUATE_SECURITY

      public static final Http2ErrorCode INADEQUATE_SECURITY
      The underlying transport has properties that do not meet the minimum security requirements.
    • HTTP_1_1_REQUIRED

      public static final Http2ErrorCode HTTP_1_1_REQUIRED
      The endpoint requires that HTTP/1.1 be used instead of HTTP/2.
  • Field Details

    • httpCode

      public final int httpCode
      The HTTP/2 error code as an integer.
  • Method Details

    • values

      public static Http2ErrorCode[] 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 Http2ErrorCode 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
    • fromHttp2

      public static Http2ErrorCode fromHttp2(int code)
      Returns the Http2ErrorCode corresponding to the given HTTP/2 code.
      Parameters:
      code - The HTTP/2 error code.
      Returns:
      The corresponding Http2ErrorCode, or null if not found.