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

public Class MalformedFrame

extends AbstractHttp3Frame
Class Inheritance
Imports
java.util.function.LongPredicate, jdk.internal.net.http.common.Logger, jdk.internal.net.http.quic.BuffersReader, jdk.internal.net.http.http3.Http3Error

An instance of MalformedFrame can be returned by AbstractHttp3Frame#decode(BuffersReader, LongPredicate, Logger) when a malformed frame is detected. This should cause the caller to send an error to its peer, and possibly throw an exception to the higher layer.

Field Summary

Modifier and TypeField and Description
private final Throwable
private final long
private final String
Inherited from jdk.internal.net.http.http3.frames.AbstractHttp3Frame:
RANDOMtype

Constructor Summary

AccessConstructor and Description
public
MalformedFrame(long type, long
- error code
errorCode
,
String
- internal debug message
msg
)

Creates Connection Error malformed frame

public
MalformedFrame(long type, long
- error code
errorCode
,
String
- internal debug message
msg
,
Throwable
- internal cause for the error, if available (can be null)
cause
)

Creates Connection Error malformed frame

Method Summary

Modifier and TypeMethod and Description
public Throwable

Returns:

the cause of the error, if available, null otherwise
getCause
()

Returns the cause of the error, if available, null otherwise.

public long

Returns:

the HTTP/3 error code that should be reported to the peer
getErrorCode
()

Returns the HTTP/3 error code that should be reported to the peer.

public String

Returns:

a message that describe the error
getMessage
()

Returns a message that describe the error.

public long
length()

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

Returns the length of this frame.

public long
size()

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

Computes the size of this frame.

public String
toString()

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

Returns a string representation of the object.

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

Field Detail

causeback to summary
private final Throwable cause
errorCodeback to summary
private final long errorCode
msgback to summary
private final String msg

Constructor Detail

MalformedFrameback to summary
public MalformedFrame(long type, long errorCode, String msg)

Creates Connection Error malformed frame

Parameters
errorCode:long

- error code

msg:String

- internal debug message

MalformedFrameback to summary
public MalformedFrame(long type, long errorCode, String msg, Throwable cause)

Creates Connection Error malformed frame

Parameters
errorCode:long

- error code

msg:String

- internal debug message

cause:Throwable

- internal cause for the error, if available (can be null)

Method Detail

getCauseback to summary
public Throwable getCause()

Returns the cause of the error, if available, null otherwise.

API Note

This is useful for logging and diagnosis purpose, typically when the error is an internal error.

Returns:Throwable

the cause of the error, if available, null otherwise

getErrorCodeback to summary
public long getErrorCode()

Returns the HTTP/3 error code that should be reported to the peer.

Returns:long

the HTTP/3 error code that should be reported to the peer

getMessageback to summary
public String getMessage()

Returns a message that describe the error.

Returns:String

a message that describe the error

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.

Implementation Specification

this method always returns 0

Annotations
@Override
sizeback to summary
public long size()

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

Doc from jdk.internal.net.http.http3.frames.AbstractHttp3Frame.size.

Computes the size of this frame. This corresponds to the length() of the frame's payload, plus the size needed to encode this length, plus the size needed to encode the frame type.

Implementation Specification

this method always returns 0

Annotations
@Override
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