Package dev.relism.flash.http2.frame
Enum Class FrameType
- All Implemented Interfaces:
Serializable,Comparable<FrameType>,Constable
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.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumWhether a frame type requires stream id 0, requires it non-zero, or permits either.Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionRFC 9113 §6.10.RFC 9113 §6.1.RFC 9113 §6.8.RFC 9113 §6.2.RFC 9113 §6.7.RFC 9113 §6.6.RFC 9113 §6.4.RFC 9113 §6.5.RFC 9113 §6.9. -
Method Summary
Modifier and TypeMethodDescriptionintcode()static FrameTypefromCode(int code) Looks up the constant for a wire type byte, ornullif it is an unrecognised (to-be-ignored) type.static intmaxKnown()The highest type code this enum recognises — anything above must be ignored per RFC 9113 §4.1.intintstatic FrameTypeReturns the enum constant of this class with the specified name.static FrameType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
DATA
RFC 9113 §6.1. Stream body bytes. Stream id required. Length: 0..MAX_FRAME_SIZE. -
HEADERS
RFC 9113 §6.2. Header block fragment (HPACK). Stream id required. -
PRIORITY
-
RST_STREAM
RFC 9113 §6.4. Stream-level error. Exactly 4 bytes (the error code). Stream id required. -
SETTINGS
RFC 9113 §6.5. Connection-level parameters. Length must be a multiple of 6. Stream id must be 0. -
PUSH_PROMISE
RFC 9113 §6.6. Never sent (Flash advertisesSETTINGS_ENABLE_PUSH=0); receiving one from a client is a protocol error. -
PING
RFC 9113 §6.7. Connection liveness / RTT probe. Exactly 8 bytes of opaque data. Stream id must be 0. -
GOAWAY
RFC 9113 §6.8. Connection shutdown notice. At least 8 bytes (last-stream-id + error code). Stream id must be 0. -
WINDOW_UPDATE
RFC 9113 §6.9. Flow-control window increment. Exactly 4 bytes. Stream id may be either (0 = connection window). -
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
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
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 nameNullPointerException- if the argument is null
-
code
public int code() -
minLength
public int minLength() -
maxLength
public int maxLength() -
streamIdRule
-
maxKnown
public static int maxKnown()The highest type code this enum recognises — anything above must be ignored per RFC 9113 §4.1. -
fromCode
Looks up the constant for a wire type byte, ornullif it is an unrecognised (to-be-ignored) type.
-