APIdia Launch Partner
Top Description Methods
jdk.internal.net.http.qpack

public Interface DecodingCallback

Known Direct Implementers
jdk.internal.net.http.Http3Stream.StreamHeadersConsumer
Imports
jdk.internal.net.http.http3.Http3Error, jdk.internal.net.http.qpack.readers.HeaderFrameReader, java.nio.ByteBuffer

Delivers results of the Decoder#decodeHeader(ByteBuffer, boolean, HeaderFrameReader) decoding operation.

Methods of the callback are never called by a decoder with any of the arguments being null.

API Note

The callback provides methods for all possible field line representations.

Names and values are CharSequences rather than Strings in order to allow users to decide whether they need to create objects. A CharSequence might be used in-place, for example, to be appended to an Appendable (e.g. StringBuilder) and then discarded.

That said, if a passed CharSequence needs to outlast the method call, it needs to be copied.

Method Summary

Modifier and TypeMethod and Description
public default boolean

Returns:

true - if error was observed; false - otherwise
hasError
()

Reports if a connection or a stream error has been observed during the decoding process

public void
onComplete()

A header fields decoding is completed.

public void
onConnectionError(Throwable
a Throwable instance
throwable
,
Http3Error
a HTTP3 error code
http3Error
)

A connection-level error observed during the decoding process.

public void
onDecoded(CharSequence
header name
name
,
CharSequence
header value
value
)

A method the more specific methods of the callback forward their calls to.

public default void
onDecoded(CharSequence
header name
name
,
CharSequence
header value
value
,
boolean
whether the value is sensitive
sensitive
)

A more finer-grained version of onDecoded(CharSequence, CharSequence) that also reports on value sensitivity.

public default void
onIndexed(long
index of a name/value pair in static or dynamic table
index
,
CharSequence
header name
name
,
CharSequence
header value
value
)

An Indexed Field Line decoded.

public default void
onLiteralWithLiteralName(CharSequence
header name
name
,
boolean
if the name was Huffman encoded
nameHuffman
,
CharSequence
header value
value
,
boolean
if the value was Huffman encoded
valueHuffman
,
boolean hideIntermediary)

A Literal Field Line with Literal Name decoded, where both a name and a value were literal.

public default void
onLiteralWithNameReference(long
index of an entry in the table
index
,
CharSequence name, CharSequence
header value
value
,
boolean
if the value was Huffman encoded
valueHuffman
,
boolean
if the header field should be written to intermediary nodes
hideIntermediary
)

A Literal Field Line with Name Reference decoded, where a name was referred by an index.

public default void
onStreamError(Throwable
a Throwable instance
throwable
,
Http3Error
a HTTP3 error code
http3Error
)

A stream-level error observed during the decoding process.

public long
streamId()

Returns request/response stream id or push stream id associated with a decoding callback.

Method Detail

hasErrorback to summary
public default boolean hasError()

Reports if a connection or a stream error has been observed during the decoding process

Returns:boolean

true - if error was observed; false - otherwise

onCompleteback to summary
public void onComplete()

A header fields decoding is completed.

onConnectionErrorback to summary
public void onConnectionError(Throwable throwable, Http3Error http3Error)

A connection-level error observed during the decoding process.

Parameters
throwable:Throwable

a Throwable instance

http3Error:Http3Error

a HTTP3 error code

onDecodedback to summary
public void onDecoded(CharSequence name, CharSequence value)

A method the more specific methods of the callback forward their calls to.

Parameters
name:CharSequence

header name

value:CharSequence

header value

onDecodedback to summary
public default void onDecoded(CharSequence name, CharSequence value, boolean sensitive)

A more finer-grained version of onDecoded(CharSequence, CharSequence) that also reports on value sensitivity.

Value sensitivity must be considered, for example, when implementing an intermediary. A value is sensitive if it was represented as Literal Header Field Never Indexed.

Implementation Specification

The default implementation invokes onDecoded(name, value).

Parameters
name:CharSequence

header name

value:CharSequence

header value

sensitive:boolean

whether the value is sensitive

onIndexedback to summary
public default void onIndexed(long index, CharSequence name, CharSequence value)

An Indexed Field Line decoded.

Implementation Specification

The default implementation invokes onDecoded(name, value, false).

Parameters
index:long

index of a name/value pair in static or dynamic table

name:CharSequence

header name

value:CharSequence

header value

onLiteralWithLiteralNameback to summary
public default void onLiteralWithLiteralName(CharSequence name, boolean nameHuffman, CharSequence value, boolean valueHuffman, boolean hideIntermediary)

A Literal Field Line with Literal Name decoded, where both a name and a value were literal.

Implementation Specification

The default implementation invokes onDecoded(name, value, false).

Parameters
name:CharSequence

header name

nameHuffman:boolean

if the name was Huffman encoded

value:CharSequence

header value

valueHuffman:boolean

if the value was Huffman encoded

onLiteralWithNameReferenceback to summary
public default void onLiteralWithNameReference(long index, CharSequence name, CharSequence value, boolean valueHuffman, boolean hideIntermediary)

A Literal Field Line with Name Reference decoded, where a name was referred by an index.

Implementation Specification

The default implementation invokes onDecoded(name, value, false).

Parameters
index:long

index of an entry in the table

value:CharSequence

header value

valueHuffman:boolean

if the value was Huffman encoded

hideIntermediary:boolean

if the header field should be written to intermediary nodes

onStreamErrorback to summary
public default void onStreamError(Throwable throwable, Http3Error http3Error)

A stream-level error observed during the decoding process.

Parameters
throwable:Throwable

a Throwable instance

http3Error:Http3Error

a HTTP3 error code

streamIdback to summary
public long streamId()

Returns request/response stream id or push stream id associated with a decoding callback.