- java.lang.Object
-
- io.netty5.buffer.api.BufferHolder<Http2GoAwayFrame>
-
- io.netty5.handler.codec.http2.DefaultHttp2GoAwayFrame
-
- All Implemented Interfaces:
Http2Frame
,Http2GoAwayFrame
,Resource<Http2GoAwayFrame>
,AutoCloseable
@UnstableApi public final class DefaultHttp2GoAwayFrame extends BufferHolder<Http2GoAwayFrame> implements Http2GoAwayFrame
The defaultHttp2GoAwayFrame
implementation.
-
-
Constructor Summary
Constructors Constructor Description DefaultHttp2GoAwayFrame(long errorCode)
Equivalent tonew DefaultHttp2GoAwayFrame(content, Unpooled.EMPTY_BUFFER)
.DefaultHttp2GoAwayFrame(long errorCode, Send<Buffer> content)
Construct a new GOAWAY message.DefaultHttp2GoAwayFrame(Http2Error error)
Equivalent tonew DefaultHttp2GoAwayFrame(error.code())
.DefaultHttp2GoAwayFrame(Http2Error error, Send<Buffer> content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Buffer
content()
Optional debugging information describing cause the GOAWAY.Http2GoAwayFrame
copy()
Produce a copy of this GOAWAY frame, which contain a copy of the frame contents.boolean
equals(Object o)
This implementation of theequals
operation is restricted to work only with instances of the same class.long
errorCode()
The reason for beginning closure of the connection.int
extraStreamIds()
The number of IDs to reserve for the receiver to use while GOAWAY is in transit.int
hashCode()
int
lastStreamId()
Returns the last stream identifier if set, or-1
else.String
name()
Returns the name of the HTTP/2 frame e.g.protected Http2GoAwayFrame
receive(Buffer buf)
Called when a sentBufferHolder
is received by the recipient.Http2GoAwayFrame
setExtraStreamIds(int extraStreamIds)
Sets the number of IDs to reserve for the receiver to use while GOAWAY is in transit.String
toString()
Http2GoAwayFrame
touch(Object hint)
Record the current access location for debugging purposes.-
Methods inherited from class io.netty5.buffer.api.BufferHolder
close, getBuffer, getBufferVolatile, isAccessible, replaceBuffer, replaceBufferVolatile, send
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.netty5.util.Resource
close, isAccessible, send
-
-
-
-
Constructor Detail
-
DefaultHttp2GoAwayFrame
public DefaultHttp2GoAwayFrame(Http2Error error)
Equivalent tonew DefaultHttp2GoAwayFrame(error.code())
.- Parameters:
error
- non-null
reason for the go away
-
DefaultHttp2GoAwayFrame
public DefaultHttp2GoAwayFrame(long errorCode)
Equivalent tonew DefaultHttp2GoAwayFrame(content, Unpooled.EMPTY_BUFFER)
.- Parameters:
errorCode
- reason for the go away
-
DefaultHttp2GoAwayFrame
public DefaultHttp2GoAwayFrame(Http2Error error, Send<Buffer> content)
- Parameters:
error
- non-null
reason for the go awaycontent
- non-null
debug data
-
-
Method Detail
-
name
public String name()
Description copied from interface:Http2Frame
Returns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.- Specified by:
name
in interfaceHttp2Frame
-
errorCode
public long errorCode()
Description copied from interface:Http2GoAwayFrame
The reason for beginning closure of the connection. Represented as an HTTP/2 error code.- Specified by:
errorCode
in interfaceHttp2GoAwayFrame
-
extraStreamIds
public int extraStreamIds()
Description copied from interface:Http2GoAwayFrame
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.- Specified by:
extraStreamIds
in interfaceHttp2GoAwayFrame
-
setExtraStreamIds
public Http2GoAwayFrame setExtraStreamIds(int extraStreamIds)
Description copied from interface:Http2GoAwayFrame
Sets the number of IDs to reserve for the receiver to use while GOAWAY is in transit.- Specified by:
setExtraStreamIds
in interfaceHttp2GoAwayFrame
- Returns:
this
- See Also:
Http2GoAwayFrame.extraStreamIds()
-
lastStreamId
public int lastStreamId()
Description copied from interface:Http2GoAwayFrame
Returns the last stream identifier if set, or-1
else.- Specified by:
lastStreamId
in interfaceHttp2GoAwayFrame
-
content
public Buffer content()
Description copied from interface:Http2GoAwayFrame
Optional debugging information describing cause the GOAWAY. Will not benull
, but may be empty.- Specified by:
content
in interfaceHttp2GoAwayFrame
-
copy
public Http2GoAwayFrame copy()
Description copied from interface:Http2GoAwayFrame
Produce a copy of this GOAWAY frame, which contain a copy of the frame contents.- Specified by:
copy
in interfaceHttp2GoAwayFrame
- Returns:
- A copy of this GOAWAY frame.
-
receive
protected Http2GoAwayFrame receive(Buffer buf)
Description copied from class:BufferHolder
Called when a sentBufferHolder
is received by the recipient. TheBufferHolder
should return a new concrete instance, that wraps the givenBuffer
object.- Specified by:
receive
in classBufferHolder<Http2GoAwayFrame>
- Parameters:
buf
- TheBuffer
that is received by the recipient, and needs to be wrapped in a newBufferHolder
instance.- Returns:
- A new buffer holder instance, containing the given buffer.
-
touch
public Http2GoAwayFrame touch(Object hint)
Description copied from interface:Resource
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.- Specified by:
touch
in interfaceResource<Http2GoAwayFrame>
- Overrides:
touch
in classBufferHolder<Http2GoAwayFrame>
- Parameters:
hint
- An optional hint about this access and its context. May benull
.- Returns:
- This resource instance.
-
equals
public boolean equals(Object o)
Description copied from class:BufferHolder
This implementation of theequals
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 extendBufferHolder
and overrideequals
method with an additional comparison logic, and we need the symmetric property of theequals
operation to be preserved.- Overrides:
equals
in classBufferHolder<Http2GoAwayFrame>
- Parameters:
o
- The reference object with which to compare.- Returns:
true
if this object is the same as the obj argument;false
otherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classBufferHolder<Http2GoAwayFrame>
-
-