java.lang.Object
org.eclipse.jetty.http3.qpack.QpackEncoder
- All Implemented Interfaces:
org.eclipse.jetty.util.component.Dumpable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnumSet<org.eclipse.jetty.http.HttpHeader> static final EnumSet<org.eclipse.jetty.http.HttpHeader> static final EnumSet<org.eclipse.jetty.http.HttpHeader> Fields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddump(Appendable out, String indent) voidencode(ByteBuffer buffer, long streamId, org.eclipse.jetty.http.MetaData metadata) Encodes aMetaDataobject into the suppliedByteBufferfor a specific HTTP/s stream.intintintintbooleaninsert(org.eclipse.jetty.http.HttpField field) A speculative insert of a Header into the Encoders Dynamic Table.voidparseInstructions(ByteBuffer buffer) Parse instructions from the Decoder stream.voidsetMaxBlockedStreams(int maxBlockedStreams) voidsetMaxHeadersSize(int maxHeadersSize) voidsetMaxTableCapacity(int maxTableCapacity) voidsetTableCapacity(int capacity) Set the capacity of the DynamicTable and send a instruction to set the capacity on the remote Decoder.protected booleanshouldHuffmanEncode(org.eclipse.jetty.http.HttpField httpField) protected booleanshouldIndex(org.eclipse.jetty.http.HttpField httpField) voidstreamCancellation(long streamId) Tells theQpackEncoderthat a particular stream has been cancelled.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dump, dumpSelf
-
Field Details
-
DO_NOT_HUFFMAN
-
DO_NOT_INDEX
-
NEVER_INDEX
-
-
Constructor Details
-
QpackEncoder
-
-
Method Details
-
getMaxBlockedStreams
public int getMaxBlockedStreams() -
setMaxBlockedStreams
public void setMaxBlockedStreams(int maxBlockedStreams) -
getMaxHeadersSize
public int getMaxHeadersSize() -
setMaxHeadersSize
public void setMaxHeadersSize(int maxHeadersSize) -
getMaxTableCapacity
public int getMaxTableCapacity() -
setMaxTableCapacity
public void setMaxTableCapacity(int maxTableCapacity) -
getTableCapacity
public int getTableCapacity() -
setTableCapacity
public void setTableCapacity(int capacity) Set the capacity of the DynamicTable and send a instruction to set the capacity on the remote Decoder.- Parameters:
capacity- the new capacity.
-
encode
public void encode(ByteBuffer buffer, long streamId, org.eclipse.jetty.http.MetaData metadata) throws QpackException Encodes a
MetaDataobject into the suppliedByteBufferfor a specific HTTP/s stream.This method may generate instructions to be sent back over the Encoder stream to the remote Decoder.
The given
bufferis filled starting from its current positionpwith N encoded bytes and upon return its position will bep + N.- Parameters:
buffer- the buffer to take the bytes of the encodedMetaData.streamId- the stream ID corresponding to this headers frame.metadata- theMetaDatato encode into the buffer.- Throws:
QpackException- if there was an error with the QPACK compression.
-
parseInstructions
Parse instructions from the Decoder stream. The Decoder stream carries an unframed sequence of instructions from the Decoder to the Encoder. This method will fully consume the suppliedByteBufferand produce instructions to update the state of the Encoder and its Dynamic Table.- Parameters:
buffer- a buffer containing bytes from the Decoder stream.- Throws:
QpackException- if there was an error parsing or handling the instructions.
-
insert
public boolean insert(org.eclipse.jetty.http.HttpField field) A speculative insert of a Header into the Encoders Dynamic Table. This will also generate an instruction to be sent over the Encoder stream to the remote Decoder.- Parameters:
field- the field to insert into the Dynamic Table.- Returns:
- true if the field was successfully inserted into the Dynamic Table.
-
streamCancellation
public void streamCancellation(long streamId) Tells theQpackEncoderthat a particular stream has been cancelled. Any state stored for this stream will be discarded. The encoder may also receive a stream cancellation instruction from the remote Decoder to cancel the stream which will be a noop if this method was called on the local encoder first.- Parameters:
streamId- the streamId of the stream that was cancelled.
-
shouldIndex
protected boolean shouldIndex(org.eclipse.jetty.http.HttpField httpField) -
shouldHuffmanEncode
protected boolean shouldHuffmanEncode(org.eclipse.jetty.http.HttpField httpField) -
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-