Top Description Fields Constructors Methods
io.netty5.handler.codec.http2

public final Class DefaultHttp2GoAwayFrame

extends BufferHolder<Http2GoAwayFrame>
implements Http2GoAwayFrame
Class Inheritance
All Implemented Interfaces
io.netty5.handler.codec.http2.Http2GoAwayFrame, io.netty5.util.Resource, java.lang.AutoCloseable, io.netty5.handler.codec.http2.Http2Frame
Annotations
@UnstableApi
Imports
io.netty5.buffer.Buffer, .BufferHolder, io.netty5.util.Send, io.netty5.util.internal.StringUtil, .UnstableApi

The default Http2GoAwayFrame implementation.

Field Summary

Modifier and TypeField and Description
private final long
private int
private final int

Constructor Summary

AccessConstructor and Description
public
DefaultHttp2GoAwayFrame(Http2Error
non-null reason for the go away
error
)

Equivalent to new DefaultHttp2GoAwayFrame(error.code()).

public
DefaultHttp2GoAwayFrame(long
reason for the go away
errorCode
)

Equivalent to new DefaultHttp2GoAwayFrame(content, Unpooled.EMPTY_BUFFER).

public
DefaultHttp2GoAwayFrame(Http2Error
non-null reason for the go away
error
,
Send<Buffer>
non-null debug data
content
)

public
DefaultHttp2GoAwayFrame(long
reason for the go away
errorCode
,
Send<Buffer>
non-null debug data
content
)

Construct a new GOAWAY message.

pack-priv
DefaultHttp2GoAwayFrame(int lastStreamId, long errorCode, Send<Buffer> content)

Construct a new GOAWAY message.

private
DefaultHttp2GoAwayFrame(int lastStreamId, long errorCode, Buffer content)

Method Summary

Modifier and TypeMethod and Description
public Buffer
content()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.content.

Optional debugging information describing cause the GOAWAY.
public Http2GoAwayFrame
copy()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.copy.

Produce a copy of this GOAWAY frame, which contain a copy of the frame contents.
public boolean
equals(Object
The reference object with which to compare.
o
)

Overrides io.netty5.buffer.BufferHolder.equals.

This implementation of the equals operation is restricted to work only with instances of the same class.
public long
errorCode()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.errorCode.

The reason for beginning closure of the connection.
public int
extraStreamIds()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.extraStreamIds.

The number of IDs to reserve for the receiver to use while GOAWAY is in transit.
public int
hashCode()

Overrides io.netty5.buffer.BufferHolder.hashCode.

Returns a hash code value for this object.
public int
lastStreamId()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.lastStreamId.

Returns the last stream identifier if set, or -1 else.
public String
name()

Implements io.netty5.handler.codec.http2.Http2Frame.name.

Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.
protected Http2GoAwayFrame
receive(Buffer
The Buffer that is received by the recipient, and needs to be wrapped in a new BufferHolder instance.
buf
)

Implements abstract io.netty5.buffer.BufferHolder.receive.

Called when a sent BufferHolder is received by the recipient.
public Http2GoAwayFrame
setExtraStreamIds(int extraStreamIds)

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.setExtraStreamIds.

Sets the number of IDs to reserve for the receiver to use while GOAWAY is in transit.
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
public Http2GoAwayFrame
touch(Object
An optional hint about this access and its context. May be null.
hint
)

Overrides io.netty5.buffer.BufferHolder.touch.

Overrides default io.netty5.util.Resource.touch.

Record the current access location for debugging purposes.
Inherited from io.netty5.buffer.BufferHolder:
closegetBuffergetBufferVolatileisAccessiblereplaceBufferreplaceBufferVolatilesend

Field Detail

errorCodeback to summary
private final long errorCode
extraStreamIdsback to summary
private int extraStreamIds
lastStreamIdback to summary
private final int lastStreamId

Constructor Detail

DefaultHttp2GoAwayFrameback to summary
public DefaultHttp2GoAwayFrame(Http2Error error)

Equivalent to new DefaultHttp2GoAwayFrame(error.code()).

Parameters
error:Http2Error

non-null reason for the go away

DefaultHttp2GoAwayFrameback to summary
public DefaultHttp2GoAwayFrame(long errorCode)

Equivalent to new DefaultHttp2GoAwayFrame(content, Unpooled.EMPTY_BUFFER).

Parameters
errorCode:long

reason for the go away

DefaultHttp2GoAwayFrameback to summary
public DefaultHttp2GoAwayFrame(Http2Error error, Send<Buffer> content)
Parameters
error:Http2Error

non-null reason for the go away

content:Send<Buffer>

non-null debug data

DefaultHttp2GoAwayFrameback to summary
public DefaultHttp2GoAwayFrame(long errorCode, Send<Buffer> content)

Construct a new GOAWAY message.

Parameters
errorCode:long

reason for the go away

content:Send<Buffer>

non-null debug data

DefaultHttp2GoAwayFrameback to summary
pack-priv DefaultHttp2GoAwayFrame(int lastStreamId, long errorCode, Send<Buffer> content)

Construct a new GOAWAY message. This constructor is for internal use only. A user should not have to specify a specific last stream identifier, but use setExtraStreamIds(int) instead.

DefaultHttp2GoAwayFrameback to summary
private DefaultHttp2GoAwayFrame(int lastStreamId, long errorCode, Buffer content)

Method Detail

contentback to summary
public Buffer content()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.content.

Doc from io.netty5.handler.codec.http2.Http2GoAwayFrame.content.

Optional debugging information describing cause the GOAWAY. Will not be null, but may be empty.

Annotations
@Override
copyback to summary
public Http2GoAwayFrame copy()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.copy.

Doc from io.netty5.handler.codec.http2.Http2GoAwayFrame.copy.

Produce a copy of this GOAWAY frame, which contain a copy of the frame contents.

Returns:Http2GoAwayFrame

A copy of this GOAWAY frame.

Annotations
@Override
equalsback to summary
public boolean equals(Object o)

Overrides io.netty5.buffer.BufferHolder.equals.

Doc from io.netty5.buffer.BufferHolder.equals.

This implementation of the equals operation is restricted to work only with instances of the same class. The reason for that is that Netty library already has a number of classes that extend BufferHolder and override equals method with an additional comparison logic, and we need the symmetric property of the equals operation to be preserved.

Parameters
o:Object

The reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
errorCodeback to summary
public long errorCode()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.errorCode.

Doc from io.netty5.handler.codec.http2.Http2GoAwayFrame.errorCode.

The reason for beginning closure of the connection. Represented as an HTTP/2 error code.

Annotations
@Override
extraStreamIdsback to summary
public int extraStreamIds()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.extraStreamIds.

Doc from io.netty5.handler.codec.http2.Http2GoAwayFrame.extraStreamIds.

The number of IDs to reserve for the receiver to use while GOAWAY is in transit. This allows for new streams currently en route to still be created, up to a point, which allows for very graceful shutdown of both sides.

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides io.netty5.buffer.BufferHolder.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for this object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object

Annotations
@Override
lastStreamIdback to summary
public int lastStreamId()

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.lastStreamId.

Doc from io.netty5.handler.codec.http2.Http2GoAwayFrame.lastStreamId.

Returns the last stream identifier if set, or -1 else.

Annotations
@Override
nameback to summary
public String name()

Implements io.netty5.handler.codec.http2.Http2Frame.name.

Doc from io.netty5.handler.codec.http2.Http2Frame.name.

Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.

Annotations
@Override
receiveback to summary
protected Http2GoAwayFrame receive(Buffer buf)

Implements abstract io.netty5.buffer.BufferHolder.receive.

Doc from io.netty5.buffer.BufferHolder.receive.

Called when a sent BufferHolder is received by the recipient. The BufferHolder should return a new concrete instance, that wraps the given Buffer object.

Parameters
buf:Buffer

The Buffer that is received by the recipient, and needs to be wrapped in a new BufferHolder instance.

Returns:Http2GoAwayFrame

A new buffer holder instance, containing the given buffer.

Annotations
@Override
setExtraStreamIdsback to summary
public Http2GoAwayFrame setExtraStreamIds(int extraStreamIds)

Implements io.netty5.handler.codec.http2.Http2GoAwayFrame.setExtraStreamIds.

Doc from io.netty5.handler.codec.http2.Http2GoAwayFrame.setExtraStreamIds.

Sets the number of IDs to reserve for the receiver to use while GOAWAY is in transit.

Returns:Http2GoAwayFrame

this

Annotations
@Override
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override
touchback to summary
public Http2GoAwayFrame touch(Object hint)

Overrides io.netty5.buffer.BufferHolder.touch.

Overrides default io.netty5.util.Resource.touch.

Doc from io.netty5.util.Resource.touch.

Record the current access location for debugging purposes. This information may be included if the resource throws a life-cycle related exception, or if it leaks. If this resource has already been closed, then this method has no effect.

Parameters
hint:Object

An optional hint about this access and its context. May be null.

Returns:Http2GoAwayFrame

This resource instance.

Annotations
@Override