Enum Class FrameType

java.lang.Object
java.lang.Enum<FrameType>
dev.relism.flash.http2.frame.FrameType
All Implemented Interfaces:
Serializable, Comparable<FrameType>, Constable

public enum FrameType extends Enum<FrameType>
The 10 HTTP/2 frame types (RFC 9113 §6), plus the shared per-type validation rules FrameValidator enforces. Values above 0x9 are not assigned a constant here — RFC 9113 §4.1 requires unknown types to be silently ignored (read and discard the payload), which Http2FrameReader's caller implements by checking type > FrameType.maxKnown() rather than by this enum growing an UNKNOWN member (an UNKNOWN constant would misleadingly suggest "a recognised category of unrecognised frame", when the correct handling is simply "not this table, skip it").

Each constant carries the RFC-mandated payload length bounds, whether a zero stream id is required/forbidden/either, and whether the frame counts toward the CONTINUATION-flood guard (bounded by Http2Limits#MAX_CONTINUATION_FRAMES_PER_BLOCK) — see FrameValidator for how these are applied and the specific RFC citation per rule.

  • Enum Constant Details

    • DATA

      public static final FrameType DATA
      RFC 9113 §6.1. Stream body bytes. Stream id required. Length: 0..MAX_FRAME_SIZE.
    • HEADERS

      public static final FrameType HEADERS
      RFC 9113 §6.2. Header block fragment (HPACK). Stream id required.
    • PRIORITY

      public static final FrameType PRIORITY
    • RST_STREAM

      public static final FrameType RST_STREAM
      RFC 9113 §6.4. Stream-level error. Exactly 4 bytes (the error code). Stream id required.
    • SETTINGS

      public static final FrameType SETTINGS
      RFC 9113 §6.5. Connection-level parameters. Length must be a multiple of 6. Stream id must be 0.
    • PUSH_PROMISE

      public static final FrameType PUSH_PROMISE
      RFC 9113 §6.6. Never sent (Flash advertises SETTINGS_ENABLE_PUSH=0); receiving one from a client is a protocol error.
    • PING

      public static final FrameType PING
      RFC 9113 §6.7. Connection liveness / RTT probe. Exactly 8 bytes of opaque data. Stream id must be 0.
    • GOAWAY

      public static final FrameType GOAWAY
      RFC 9113 §6.8. Connection shutdown notice. At least 8 bytes (last-stream-id + error code). Stream id must be 0.
    • WINDOW_UPDATE

      public static final FrameType WINDOW_UPDATE
      RFC 9113 §6.9. Flow-control window increment. Exactly 4 bytes. Stream id may be either (0 = connection window).
    • CONTINUATION

      public static final FrameType CONTINUATION
      RFC 9113 §6.10. Continuation of a header block that did not fit one HEADERS/PUSH_PROMISE frame. Stream id required.
  • Method Details

    • values

      public static FrameType[] 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 FrameType 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()
    • minLength

      public int minLength()
    • maxLength

      public int maxLength()
    • streamIdRule

      public FrameType.StreamIdRule streamIdRule()
    • maxKnown

      public static int maxKnown()
      The highest type code this enum recognises — anything above must be ignored per RFC 9113 §4.1.
    • fromCode

      public static FrameType fromCode(int code)
      Looks up the constant for a wire type byte, or null if it is an unrecognised (to-be-ignored) type.