Top Inners Fields Constructors Methods
org.eclipse.jetty.http3.qpack

public Class QpackDecoder

extends Object
implements Dumpable
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.util.component.Dumpable
Imports
java.io.IOException, java.nio.ByteBuffer, java.util.ArrayList, .HashMap, .Iterator, .List, .Map, java.util.concurrent.atomic.AtomicInteger, java.util.function.LongSupplier, org.eclipse.jetty.http.HttpField, .MetaData, org.eclipse.jetty.http.compression.NBitIntegerDecoder, org.eclipse.jetty.http3.qpack.internal.QpackContext, org.eclipse.jetty.http3.qpack.internal.instruction.InsertCountIncrementInstruction, .SectionAcknowledgmentInstruction, .StreamCancellationInstruction, org.eclipse.jetty.http3.qpack.internal.parser.DecoderInstructionParser, .EncodedFieldSection, org.eclipse.jetty.http3.qpack.internal.table.DynamicTable, .Entry, .StaticTable, org.eclipse.jetty.util.BufferUtil, org.eclipse.jetty.util.component.Dumpable, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static interface
pack-priv class
QpackDecoder.InstructionHandler

This delivers notifications from the DecoderInstruction parser directly into the Decoder.

private static class

Field Summary

Modifier and TypeField and Description
private LongSupplier
private final Map<Long, AtomicInteger>
private final QpackContext
private final List<EncodedFieldSection>
private final Instruction.Handler
private final QpackDecoder.InstructionHandler
private final List<Instruction>
private final NBitIntegerDecoder
private int
private int
private int
private final List<QpackDecoder.MetaDataNotification>
private final DecoderInstructionParser
private static final Logger

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private void
public boolean

Returns:

true if the MetaData could be decoded immediately without requiring addition state in the DynamicTable.
decode
(long
the stream ID corresponding to this headers frame.
streamId
,
ByteBuffer
the content of the headers frame.
buffer
,
QpackDecoder.Handler
a handler that is invoked when the MetaData is able to be decoded.
handler
)

Decode a buffer into a MetaData object given a HTTP/3 stream ID. The buffer must be the complete content of a headers frame and will be fully consumed.

private static int
decodeInsertCount(int encInsertCount, int totalNumInserts, int maxTableCapacity)

public void
dump(Appendable out, String indent)

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

pack-priv QpackDecoder.InstructionHandler
public int
public int
public int
pack-priv QpackContext
private void
private void
notifyMetaDataHandler(boolean wasBlocked)

public void
parseInstructions(ByteBuffer
a buffer containing bytes from the Encoder stream.
buffer
)

Parse instructions from the Encoder stream.

public void
setBeginNanoTimeSupplier(LongSupplier beginNanoTimeSupplier)

public void
setMaxBlockedStreams(int maxBlockedStreams)

public void
setMaxHeadersSize(int
The maximum allowed size of a headers block, expressed as total of all name and value characters, plus 32 per field
maxHeadersSize
)

public void
setMaxTableCapacity(int maxTableCapacity)

public void
streamCancellation(long
the streamId of the stream that was cancelled.
streamId
)

Tells the QpackDecoder that a particular stream has been cancelled.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

_beginNanoTimeSupplierback to summary
private LongSupplier _beginNanoTimeSupplier
_blockedStreamsback to summary
private final Map<Long, AtomicInteger> _blockedStreams
_contextback to summary
private final QpackContext _context
_encodedFieldSectionsback to summary
private final List<EncodedFieldSection> _encodedFieldSections
_handlerback to summary
private final Instruction.Handler _handler
_instructionHandlerback to summary
private final QpackDecoder.InstructionHandler _instructionHandler
_instructionsback to summary
private final List<Instruction> _instructions
_integerDecoderback to summary
private final NBitIntegerDecoder _integerDecoder
_maxBlockedStreamsback to summary
private int _maxBlockedStreams
_maxHeadersSizeback to summary
private int _maxHeadersSize
_maxTableCapacityback to summary
private int _maxTableCapacity
_metaDataNotificationsback to summary
private final List<QpackDecoder.MetaDataNotification> _metaDataNotifications
_parserback to summary
private final DecoderInstructionParser _parser
LOGback to summary
private static final Logger LOG

Constructor Detail

QpackDecoderback to summary
public QpackDecoder(Instruction.Handler handler)

Method Detail

checkEncodedFieldSectionsback to summary
private void checkEncodedFieldSections() throws QpackException
decodeback to summary
public boolean decode(long streamId, ByteBuffer buffer, QpackDecoder.Handler handler) throws QpackException

Decode a buffer into a MetaData object given a HTTP/3 stream ID. The buffer must be the complete content of a headers frame and will be fully consumed. It may be that the Dynamic Table does not yet contain the state required to decode this headers frame, in this case the encoded headers will be saved until the required state arrives on the instruction stream to update the dynamic table.

This method may generate instructions to be sent back over the Decoder stream to the remote Encoder.

Parameters
streamId:long

the stream ID corresponding to this headers frame.

buffer:ByteBuffer

the content of the headers frame.

handler:QpackDecoder.Handler

a handler that is invoked when the MetaData is able to be decoded.

Returns:boolean

true if the MetaData could be decoded immediately without requiring addition state in the DynamicTable.

Exceptions
QpackException:
if there was an error with the QPACK decompression.
decodeInsertCountback to summary
private static int decodeInsertCount(int encInsertCount, int totalNumInserts, int maxTableCapacity) throws QpackException
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
getInstructionHandlerback to summary
pack-priv QpackDecoder.InstructionHandler getInstructionHandler()
getMaxBlockedStreamsback to summary
public int getMaxBlockedStreams()
getMaxHeadersSizeback to summary
public int getMaxHeadersSize()
getMaxTableCapacityback to summary
public int getMaxTableCapacity()
getQpackContextback to summary
pack-priv QpackContext getQpackContext()
notifyInstructionHandlerback to summary
private void notifyInstructionHandler()
notifyMetaDataHandlerback to summary
private void notifyMetaDataHandler(boolean wasBlocked)
parseInstructionsback to summary
public void parseInstructions(ByteBuffer buffer) throws SessionException

Parse instructions from the Encoder stream. The Encoder stream carries an unframed sequence of instructions from the Encoder to the Decoder. This method will fully consume the supplied ByteBuffer and produce instructions to update the state of the Decoder and its Dynamic Table.

Parameters
buffer:ByteBuffer

a buffer containing bytes from the Encoder stream.

Exceptions
SessionException:
if there was an error parsing or handling the instructions.
setBeginNanoTimeSupplierback to summary
public void setBeginNanoTimeSupplier(LongSupplier beginNanoTimeSupplier)
setMaxBlockedStreamsback to summary
public void setMaxBlockedStreams(int maxBlockedStreams)
setMaxHeadersSizeback to summary
public void setMaxHeadersSize(int maxHeadersSize)
Parameters
maxHeadersSize:int

The maximum allowed size of a headers block, expressed as total of all name and value characters, plus 32 per field

setMaxTableCapacityback to summary
public void setMaxTableCapacity(int maxTableCapacity)
streamCancellationback to summary
public void streamCancellation(long streamId)

Tells the QpackDecoder that a particular stream has been cancelled. Any encoded field sections for this stream will be discarded and a stream cancellation instruction will be sent to the remote Encoder.

Parameters
streamId:long

the streamId of the stream that was cancelled.

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
org.eclipse.jetty.http3.qpack back to summary

public Interface QpackDecoder.Handler


Method Summary

Modifier and TypeMethod and Description
public void
onMetaData(long streamId, MetaData metadata, boolean wasBlocked)

Method Detail

onMetaDataback to summary
public void onMetaData(long streamId, MetaData metadata, boolean wasBlocked)
org.eclipse.jetty.http3.qpack back to summary

pack-priv Class QpackDecoder.InstructionHandler

extends Object
implements Handler
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.http3.qpack.QpackDecoder.InstructionHandler
All Implemented Interfaces
org.eclipse.jetty.http3.qpack.internal.parser.DecoderInstructionParser.Handler

This delivers notifications from the DecoderInstruction parser directly into the Decoder.

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

InstructionHandlerback to summary
pack-priv InstructionHandler()

Method Detail

onDuplicateback to summary
public void onDuplicate(int index) throws QpackException

Implements org.eclipse.jetty.http3.qpack.internal.parser.DecoderInstructionParser.Handler.onDuplicate.

Annotations
@Override
onInsertNameWithReferenceback to summary
public void onInsertNameWithReference(int nameIndex, boolean isDynamicTableIndex, String value) throws QpackException

Implements org.eclipse.jetty.http3.qpack.internal.parser.DecoderInstructionParser.Handler.onInsertNameWithReference.

Annotations
@Override
onInsertWithLiteralNameback to summary
public void onInsertWithLiteralName(String name, String value) throws QpackException

Implements org.eclipse.jetty.http3.qpack.internal.parser.DecoderInstructionParser.Handler.onInsertWithLiteralName.

Annotations
@Override
onSetDynamicTableCapacityback to summary
public void onSetDynamicTableCapacity(int capacity) throws QpackException

Implements org.eclipse.jetty.http3.qpack.internal.parser.DecoderInstructionParser.Handler.onSetDynamicTableCapacity.

Annotations
@Override
org.eclipse.jetty.http3.qpack back to summary

private Class QpackDecoder.MetaDataNotification

extends Object
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.http3.qpack.QpackDecoder.MetaDataNotification

Field Summary

Modifier and TypeField and Description
private final QpackDecoder.Handler
private final MetaData
private final long

Constructor Summary

AccessConstructor and Description
public
MetaDataNotification(long streamId, MetaData metaData, QpackDecoder.Handler handler)

Method Summary

Modifier and TypeMethod and Description
public void
notifyHandler(boolean wasBlocked)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_handlerback to summary
private final QpackDecoder.Handler _handler
_metaDataback to summary
private final MetaData _metaData
_streamIdback to summary
private final long _streamId

Constructor Detail

MetaDataNotificationback to summary
public MetaDataNotification(long streamId, MetaData metaData, QpackDecoder.Handler handler)

Method Detail

notifyHandlerback to summary
public void notifyHandler(boolean wasBlocked)