- 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 defaultHttp2GoAwayFrameimplementation.
-
-
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 Buffercontent()Optional debugging information describing cause the GOAWAY.Http2GoAwayFramecopy()Produce a copy of this GOAWAY frame, which contain a copy of the frame contents.booleanequals(Object o)This implementation of theequalsoperation is restricted to work only with instances of the same class.longerrorCode()The reason for beginning closure of the connection.intextraStreamIds()The number of IDs to reserve for the receiver to use while GOAWAY is in transit.inthashCode()intlastStreamId()Returns the last stream identifier if set, or-1else.Stringname()Returns the name of the HTTP/2 frame e.g.protected Http2GoAwayFramereceive(Buffer buf)Called when a sentBufferHolderis received by the recipient.Http2GoAwayFramesetExtraStreamIds(int extraStreamIds)Sets the number of IDs to reserve for the receiver to use while GOAWAY is in transit.StringtoString()Http2GoAwayFrametouch(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-nullreason 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-nullreason for the go awaycontent- non-nulldebug data
-
-
Method Detail
-
name
public String name()
Description copied from interface:Http2FrameReturns the name of the HTTP/2 frame e.g. DATA, GOAWAY, etc.- Specified by:
namein interfaceHttp2Frame
-
errorCode
public long errorCode()
Description copied from interface:Http2GoAwayFrameThe reason for beginning closure of the connection. Represented as an HTTP/2 error code.- Specified by:
errorCodein interfaceHttp2GoAwayFrame
-
extraStreamIds
public int extraStreamIds()
Description copied from interface:Http2GoAwayFrameThe 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:
extraStreamIdsin interfaceHttp2GoAwayFrame
-
setExtraStreamIds
public Http2GoAwayFrame setExtraStreamIds(int extraStreamIds)
Description copied from interface:Http2GoAwayFrameSets the number of IDs to reserve for the receiver to use while GOAWAY is in transit.- Specified by:
setExtraStreamIdsin interfaceHttp2GoAwayFrame- Returns:
this- See Also:
Http2GoAwayFrame.extraStreamIds()
-
lastStreamId
public int lastStreamId()
Description copied from interface:Http2GoAwayFrameReturns the last stream identifier if set, or-1else.- Specified by:
lastStreamIdin interfaceHttp2GoAwayFrame
-
content
public Buffer content()
Description copied from interface:Http2GoAwayFrameOptional debugging information describing cause the GOAWAY. Will not benull, but may be empty.- Specified by:
contentin interfaceHttp2GoAwayFrame
-
copy
public Http2GoAwayFrame copy()
Description copied from interface:Http2GoAwayFrameProduce a copy of this GOAWAY frame, which contain a copy of the frame contents.- Specified by:
copyin interfaceHttp2GoAwayFrame- Returns:
- A copy of this GOAWAY frame.
-
receive
protected Http2GoAwayFrame receive(Buffer buf)
Description copied from class:BufferHolderCalled when a sentBufferHolderis received by the recipient. TheBufferHoldershould return a new concrete instance, that wraps the givenBufferobject.- Specified by:
receivein classBufferHolder<Http2GoAwayFrame>- Parameters:
buf- TheBufferthat is received by the recipient, and needs to be wrapped in a newBufferHolderinstance.- Returns:
- A new buffer holder instance, containing the given buffer.
-
touch
public Http2GoAwayFrame touch(Object hint)
Description copied from interface:ResourceRecord 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:
touchin interfaceResource<Http2GoAwayFrame>- Overrides:
touchin 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:BufferHolderThis implementation of theequalsoperation 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 extendBufferHolderand overrideequalsmethod with an additional comparison logic, and we need the symmetric property of theequalsoperation to be preserved.- Overrides:
equalsin classBufferHolder<Http2GoAwayFrame>- Parameters:
o- The reference object with which to compare.- Returns:
trueif this object is the same as the obj argument;falseotherwise.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classBufferHolder<Http2GoAwayFrame>
-
-