APIdia Launch Partner
Top Description Fields Constructors Methods
jdk.internal.net.http.http3.frames

public Class SettingsFrame

extends AbstractHttp3Frame
Class Inheritance
Imports
java.nio.BufferUnderflowException, .ByteBuffer, java.util.Arrays, jdk.internal.net.http.common.Logger, jdk.internal.net.http.http3.Http3Error, jdk.internal.net.http.quic.BuffersReader, .VariableLengthEncoder

This class models an HTTP/3 SETTINGS frame

Field Summary

Modifier and TypeField and Description
public static final long
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
private static final long
public static final int
private final long[]
public static final int
public static final int
public static final int
public static final int
TYPE

The SETTINGS frame type, as defined by HTTP/3

private long
private long
Inherited from jdk.internal.net.http.http3.frames.AbstractHttp3Frame:
RANDOMtype

Constructor Summary

AccessConstructor and Description
public
SettingsFrame(long
the id of an undefined (reserved) parameter
undefinedId
,
long
a random value for the undefined parameter
undefinedValue
)

Creates a new HTTP/3 SETTINGS frame, including the given reserved identifier id and value pair.

public
SettingsFrame()

Creates a new empty SETTINGS frame, and allocate a random reserved id and value pair.

Method Summary

Modifier and TypeMethod and Description
public static AbstractHttp3Frame

Returns:

a new SettingsFrame frame, or a MalformedFrame.
decodeFrame
(BuffersReader
a reader containing bytes
reader
,
Logger debug)

Decodes a SETTINGS frame from the given reader.

public static SettingsFrame
public synchronized long

Returns:

the value of the given parameter, if present, -1, if absent
getParameter
(int
the parameter id
paramID
)

Get the parameter value for the given parameter id

public boolean
isIllegal(long parameterId)

public static boolean

Returns:

true if this is one of the reserved identifiers
isReservedId
(long
the parameter id
id
)

Tells whether the given id is one of the undefined parameter ids that are reserved and have no meaning.

public long
length()

Implements jdk.internal.net.http.http3.frames.Http3Frame.length.

Returns the length of this frame.

private String
name(long i)

public static long
public static long
public synchronized SettingsFrame

Returns:

this
setParameter
(long
the parameter id
paramID
,
long
the parameter value
value
)

Sets the given parameter to the given value.

public String
toString()

Overrides jdk.internal.net.http.http3.frames.AbstractHttp3Frame.toString.

Returns a string representation of the object.

public void
writeFrame(ByteBuffer
a byte buffer to write this frame into
buf
)

Writes this frame to the given buffer.

Inherited from jdk.internal.net.http.http3.frames.AbstractHttp3Frame:
checkPayloadSizedecodeRequiredTypeheadersSizesizestreamingLengthtypetypeAsString

Field Detail

DEFAULT_SETTINGS_MAX_FIELD_SECTION_SIZEback to summary
public static final long DEFAULT_SETTINGS_MAX_FIELD_SECTION_SIZE
DEFAULT_SETTINGS_QPACK_BLOCKED_STREAMSback to summary
public static final int DEFAULT_SETTINGS_QPACK_BLOCKED_STREAMS
DEFAULT_SETTINGS_QPACK_MAX_TABLE_CAPACITYback to summary
public static final int DEFAULT_SETTINGS_QPACK_MAX_TABLE_CAPACITY
ENABLE_PUSHback to summary
public static final int ENABLE_PUSH
INITIAL_WINDOW_SIZEback to summary
public static final int INITIAL_WINDOW_SIZE
MAX_CONCURRENT_STREAMSback to summary
public static final int MAX_CONCURRENT_STREAMS
MAX_FRAME_SIZEback to summary
public static final int MAX_FRAME_SIZE
MAX_Nback to summary
private static final long MAX_N
MAX_PARAMback to summary
public static final int MAX_PARAM
parametersback to summary
private final long[] parameters
SETTINGS_MAX_FIELD_SECTION_SIZEback to summary
public static final int SETTINGS_MAX_FIELD_SECTION_SIZE
SETTINGS_QPACK_BLOCKED_STREAMSback to summary
public static final int SETTINGS_QPACK_BLOCKED_STREAMS
SETTINGS_QPACK_MAX_TABLE_CAPACITYback to summary
public static final int SETTINGS_QPACK_MAX_TABLE_CAPACITY
TYPEback to summary
public static final int TYPE

The SETTINGS frame type, as defined by HTTP/3

undefinedIdback to summary
private long undefinedId
undefinedValueback to summary
private long undefinedValue

Constructor Detail

SettingsFrameback to summary
public SettingsFrame(long undefinedId, long undefinedValue)

Creates a new HTTP/3 SETTINGS frame, including the given reserved identifier id and value pair.

Implementation Note

We only keep one reserved id/value pair - there's no reason to keep more...

Parameters
undefinedId:long

the id of an undefined (reserved) parameter

undefinedValue:long

a random value for the undefined parameter

SettingsFrameback to summary
public SettingsFrame()

Creates a new empty SETTINGS frame, and allocate a random reserved id and value pair.

Method Detail

decodeFrameback to summary
public static AbstractHttp3Frame decodeFrame(BuffersReader reader, Logger debug)

Decodes a SETTINGS frame from the given reader. This method is expected to be called when the reader contains enough bytes to decode the frame.

Parameters
reader:BuffersReader

a reader containing bytes

Returns:AbstractHttp3Frame

a new SettingsFrame frame, or a MalformedFrame.

Exceptions
BufferUnderflowException:
if the reader doesn't contain enough bytes to decode the frame
defaultRFCSettingsback to summary
public static SettingsFrame defaultRFCSettings()
getParameterback to summary
public synchronized long getParameter(int paramID)

Get the parameter value for the given parameter id

Parameters
paramID:int

the parameter id

Returns:long

the value of the given parameter, if present, -1, if absent

Exceptions
IllegalArgumentException:
if the parameter id is negative or illegal
isIllegalback to summary
public boolean isIllegal(long parameterId)
isReservedIdback to summary
public static boolean isReservedId(long id)

Tells whether the given id is one of the undefined parameter ids that are reserved and have no meaning.

API Note

Setting identifiers of the format 0x1f * N + 0x21 for non-negative integer values of N are reserved to exercise the requirement that unknown identifiers be ignored

Parameters
id:long

the parameter id

Returns:boolean

true if this is one of the reserved identifiers

lengthback to summary
public long length()

Implements jdk.internal.net.http.http3.frames.Http3Frame.length.

Doc from jdk.internal.net.http.http3.frames.Http3Frame.length.

Returns the length of this frame.

Annotations
@Override
nameback to summary
private String name(long i)
nextRandomParameterValueback to summary
public static long nextRandomParameterValue()
nextRandomReservedParameterIdback to summary
public static long nextRandomReservedParameterId()
setParameterback to summary
public synchronized SettingsFrame setParameter(long paramID, long value)

Sets the given parameter to the given value.

Parameters
paramID:long

the parameter id

value:long

the parameter value

Returns:SettingsFrame

this

Exceptions
IllegalArgumentException:
if the parameter id is negative or illegal
toStringback to summary
public String toString()

Overrides jdk.internal.net.http.http3.frames.AbstractHttp3Frame.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
writeFrameback to summary
public void writeFrame(ByteBuffer buf)

Writes this frame to the given buffer.

Parameters
buf:ByteBuffer

a byte buffer to write this frame into

Exceptions
BufferUnderflowException:
if the buffer doesn't have enough space