Top Description Inners Fields Constructors Methods
org.eclipse.jetty.http3.parser

public Class MessageParser

extends Object
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.function.BooleanSupplier, .UnaryOperator, org.eclipse.jetty.http3.Grease, .HTTP3ErrorCode, org.eclipse.jetty.http3.frames.FrameType, org.eclipse.jetty.http3.qpack.QpackDecoder, org.eclipse.jetty.util.BufferUtil, .NanoTime, org.slf4j.Logger, .LoggerFactory

The HTTP/3 protocol parser.

This parser makes use of the HeaderParser and of BodyParsers to parse HTTP/3 frames.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
private static enum

Field Summary

Modifier and TypeField and Description
private long
private boolean
private final BodyParser[]
private boolean
private final QpackDecoder
private final HeaderParser
private final BooleanSupplier
private final ParserListener
private static final Logger
private MessageParser.State
private final long
private BodyParser

Constructor Summary

AccessConstructor and Description
public
MessageParser(ParserListener listener, QpackDecoder decoder, long streamId, BooleanSupplier isLast)

Method Summary

Modifier and TypeMethod and Description
private long
public ParserListener
public void
public boolean
public MessageParser.Result

Returns:

the result of the parsing
parse
(ByteBuffer
the buffer to parse
buffer
)

Parses the given buffer bytes and emit events to a ParserListener.

private void
private void
sessionFailure(ByteBuffer buffer, long error, String reason, Throwable failure)

public void
setDataMode(boolean enable)

private void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

beginNanoTimeback to summary
private long beginNanoTime
beginNanoTimeStoredback to summary
private boolean beginNanoTimeStored
bodyParsersback to summary
private final BodyParser[] bodyParsers
dataModeback to summary
private boolean dataMode
decoderback to summary
private final QpackDecoder decoder
headerParserback to summary
private final HeaderParser headerParser
isLastback to summary
private final BooleanSupplier isLast
listenerback to summary
private final ParserListener listener
LOGback to summary
private static final Logger LOG
stateback to summary
private MessageParser.State state
streamIdback to summary
private final long streamId
unknownBodyParserback to summary
private BodyParser unknownBodyParser

Constructor Detail

MessageParserback to summary
public MessageParser(ParserListener listener, QpackDecoder decoder, long streamId, BooleanSupplier isLast)

Method Detail

getBeginNanoTimeback to summary
private long getBeginNanoTime()
getListenerback to summary
public ParserListener getListener()
initback to summary
public void init(UnaryOperator<ParserListener> wrapper)
isDataModeback to summary
public boolean isDataMode()
parseback to summary
public MessageParser.Result parse(ByteBuffer buffer)

Parses the given buffer bytes and emit events to a ParserListener.

Only the bytes of one frame are consumed, therefore when this method returns, the buffer may contain unconsumed bytes, for example for other frames.

Parameters
buffer:ByteBuffer

the buffer to parse

Returns:MessageParser.Result

the result of the parsing

resetback to summary
private void reset()
sessionFailureback to summary
private void sessionFailure(ByteBuffer buffer, long error, String reason, Throwable failure)
setDataModeback to summary
public void setDataMode(boolean enable)
storeBeginNanoTimeback to summary
private void storeBeginNanoTime()
org.eclipse.jetty.http3.parser back to summary

public final Enum MessageParser.Result

extends Enum<MessageParser.Result>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final MessageParser.Result
BLOCKED_FRAME

Indicates that a frame was parsed but its notification was deferred.

public static final MessageParser.Result
FRAME

Indicates that a frame was parsed.

public static final MessageParser.Result
NO_FRAME

Indicates that no frame was parsed, either for lack of bytes, or because or errors.

public static final MessageParser.Result
SWITCH_MODE

Indicates that a DATA frame was expected, but a HEADERS was found instead.

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static MessageParser.Result
public static MessageParser.Result[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BLOCKED_FRAMEback to summary
public static final MessageParser.Result BLOCKED_FRAME

Indicates that a frame was parsed but its notification was deferred. This is the case of HEADERS frames that are waiting to be unblocked.

FRAMEback to summary
public static final MessageParser.Result FRAME

Indicates that a frame was parsed.

NO_FRAMEback to summary
public static final MessageParser.Result NO_FRAME

Indicates that no frame was parsed, either for lack of bytes, or because or errors.

SWITCH_MODEback to summary
public static final MessageParser.Result SWITCH_MODE

Indicates that a DATA frame was expected, but a HEADERS was found instead.

Constructor Detail

Resultback to summary
private Result()

Method Detail

valueOfback to summary
public static MessageParser.Result valueOf(String name)
valuesback to summary
public static MessageParser.Result[] values()
org.eclipse.jetty.http3.parser back to summary

private final Enum MessageParser.State

extends Enum<MessageParser.State>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final MessageParser.State
public static final MessageParser.State

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static MessageParser.State
public static MessageParser.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BODYback to summary
public static final MessageParser.State BODY
HEADERback to summary
public static final MessageParser.State HEADER

Constructor Detail

Stateback to summary
private State()

Method Detail

valueOfback to summary
public static MessageParser.State valueOf(String name)
valuesback to summary
public static MessageParser.State[] values()