Top Description Constructors Methods
org.glassfish.grizzly.http2.hpack

public abstract Class DecodingCallback

extends Object
Class Inheritance
Annotations
@SuppressWarnings:UnusedParameters

Delivers results of the decoding operation.

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

The callback provides methods for all possible binary representations. This could be useful for implementing an intermediary, logging, debugging, etc.

The callback is an interface in order to interoperate with lambdas (in the most common use case):

{
    @code
    DecodingCallback callback = (name, value) -> System.out.println(name + ", " + value);
}

Names and values are CharSequences rather than Strings in order to allow users to decide whether or not 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.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
onDecoded(CharSequence
header name
name
,
CharSequence
header value
value
)

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

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

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

public void
onIndexed(int
index of an entry in the table
index
,
CharSequence
header name
name
,
CharSequence
header value
value
)

An Indexed Header Field decoded.

public void
onLiteral(int
index of an entry in the table
index
,
CharSequence
header name
name
,
CharSequence
header value
value
,
boolean
if the value was Huffman encoded
valueHuffman
)

A Literal Header Field without Indexing decoded, where a name was referred by an index.

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

A Literal Header Field without Indexing decoded, where both a name and a value were literal.

public void
onLiteralNeverIndexed(int
index of an entry in the table
index
,
CharSequence
header name
name
,
CharSequence
header value
value
,
boolean
if the value was Huffman encoded
valueHuffman
)

A Literal Header Field Never Indexed decoded, where a name was referred by an index.

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

A Literal Header Field Never Indexed decoded, where both a name and a value were literal.

public void
onLiteralWithIndexing(int
index of an entry in the table
index
,
CharSequence
header name
name
,
CharSequence
header value
value
,
boolean
if the value was Huffman encoded
valueHuffman
)

A Literal Header Field with Incremental Indexing decoded, where a name was referred by an index.

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

A Literal Header Field with Incremental Indexing decoded, where both a name and a value were literal.

public void
onSizeUpdate(int
new capacity of the header table
capacity
)

A Dynamic Table Size Update decoded.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DecodingCallbackback to summary
public DecodingCallback()

Method Detail

onDecodedback to summary
public abstract 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 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.

It is required that intermediaries MUST use the same representation for encoding this header field in order to protect its value which is not to be put at risk by compressing it.

The default implementation invokes onDecoded(name, value).

Parameters
name:CharSequence

header name

value:CharSequence

header value

sensitive:boolean

whether or not the value is sensitive

See Also
onLiteralNeverIndexed(int, CharSequence, CharSequence, boolean), onLiteralNeverIndexed(CharSequence, boolean, CharSequence, boolean)
onIndexedback to summary
public void onIndexed(int index, CharSequence name, CharSequence value)

An Indexed Header Field decoded.

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

Parameters
index:int

index of an entry in the table

name:CharSequence

header name

value:CharSequence

header value

onLiteralback to summary
public void onLiteral(int index, CharSequence name, CharSequence value, boolean valueHuffman)

A Literal Header Field without Indexing decoded, where a name was referred by an index.

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

Parameters
index:int

index of an entry in the table

name:CharSequence

header name

value:CharSequence

header value

valueHuffman:boolean

if the value was Huffman encoded

onLiteralback to summary
public void onLiteral(CharSequence name, boolean nameHuffman, CharSequence value, boolean valueHuffman)

A Literal Header Field without Indexing decoded, where both a name and a value were literal.

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

onLiteralNeverIndexedback to summary
public void onLiteralNeverIndexed(int index, CharSequence name, CharSequence value, boolean valueHuffman)

A Literal Header Field Never Indexed decoded, where a name was referred by an index.

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

Parameters
index:int

index of an entry in the table

name:CharSequence

header name

value:CharSequence

header value

valueHuffman:boolean

if the value was Huffman encoded

onLiteralNeverIndexedback to summary
public void onLiteralNeverIndexed(CharSequence name, boolean nameHuffman, CharSequence value, boolean valueHuffman)

A Literal Header Field Never Indexed decoded, where both a name and a value were literal.

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

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

onLiteralWithIndexingback to summary
public void onLiteralWithIndexing(int index, CharSequence name, CharSequence value, boolean valueHuffman)

A Literal Header Field with Incremental Indexing decoded, where a name was referred by an index.

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

Parameters
index:int

index of an entry in the table

name:CharSequence

header name

value:CharSequence

header value

valueHuffman:boolean

if the value was Huffman encoded

onLiteralWithIndexingback to summary
public void onLiteralWithIndexing(CharSequence name, boolean nameHuffman, CharSequence value, boolean valueHuffman)

A Literal Header Field with Incremental Indexing decoded, where both a name and a value were literal.

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

onSizeUpdateback to summary
public void onSizeUpdate(int capacity)

A Dynamic Table Size Update decoded.

The default implementation does nothing.

Parameters
capacity:int

new capacity of the header table