- java.lang.Object
-
- io.netty5.handler.codec.http2.Http2ConnectionAdapter
-
- All Implemented Interfaces:
Http2Connection.Listener
@UnstableApi public class Http2ConnectionAdapter extends Object implements Http2Connection.Listener
Provides empty implementations of allHttp2Connection.Listener
methods.
-
-
Constructor Summary
Constructors Constructor Description Http2ConnectionAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
onGoAwayReceived(int lastStreamId, long errorCode, Buffer debugData)
Called when aGOAWAY
was received from the remote endpoint.void
onGoAwaySent(int lastStreamId, long errorCode, Buffer debugData)
Called when aGOAWAY
frame was sent for the connection.void
onStreamActive(Http2Stream stream)
Notifies the listener that the given stream was made active (i.e.void
onStreamAdded(Http2Stream stream)
Notifies the listener that the given stream was added to the connection.void
onStreamClosed(Http2Stream stream)
Notifies the listener that the given stream is nowCLOSED
in both directions and will no longer be accessible viaHttp2Connection.forEachActiveStream(Http2StreamVisitor)
.void
onStreamHalfClosed(Http2Stream stream)
Notifies the listener that the given stream has transitioned fromOPEN
toHALF CLOSED
.void
onStreamRemoved(Http2Stream stream)
Notifies the listener that the given stream has now been removed from the connection and will no longer be returned viaHttp2Connection.stream(int)
.
-
-
-
Method Detail
-
onStreamAdded
public void onStreamAdded(Http2Stream stream)
Description copied from interface:Http2Connection.Listener
Notifies the listener that the given stream was added to the connection. This stream may not yet be active (i.e.OPEN
orHALF CLOSED
).If a
RuntimeException
is thrown it will be logged and not propagated. Throwing from this method is not supported and is considered a programming error.- Specified by:
onStreamAdded
in interfaceHttp2Connection.Listener
-
onStreamActive
public void onStreamActive(Http2Stream stream)
Description copied from interface:Http2Connection.Listener
Notifies the listener that the given stream was made active (i.e.OPEN
orHALF CLOSED
).If a
RuntimeException
is thrown it will be logged and not propagated. Throwing from this method is not supported and is considered a programming error.- Specified by:
onStreamActive
in interfaceHttp2Connection.Listener
-
onStreamHalfClosed
public void onStreamHalfClosed(Http2Stream stream)
Description copied from interface:Http2Connection.Listener
Notifies the listener that the given stream has transitioned fromOPEN
toHALF CLOSED
. This method will not be called until a state transition occurs from whenHttp2Connection.Listener.onStreamActive(Http2Stream)
was called. The stream can be inspected to determine which side isHALF CLOSED
.If a
RuntimeException
is thrown it will be logged and not propagated. Throwing from this method is not supported and is considered a programming error.- Specified by:
onStreamHalfClosed
in interfaceHttp2Connection.Listener
-
onStreamClosed
public void onStreamClosed(Http2Stream stream)
Description copied from interface:Http2Connection.Listener
Notifies the listener that the given stream is nowCLOSED
in both directions and will no longer be accessible viaHttp2Connection.forEachActiveStream(Http2StreamVisitor)
.If a
RuntimeException
is thrown it will be logged and not propagated. Throwing from this method is not supported and is considered a programming error.- Specified by:
onStreamClosed
in interfaceHttp2Connection.Listener
-
onStreamRemoved
public void onStreamRemoved(Http2Stream stream)
Description copied from interface:Http2Connection.Listener
Notifies the listener that the given stream has now been removed from the connection and will no longer be returned viaHttp2Connection.stream(int)
. The connection may maintain inactive streams for some time before removing them.If a
RuntimeException
is thrown it will be logged and not propagated. Throwing from this method is not supported and is considered a programming error.- Specified by:
onStreamRemoved
in interfaceHttp2Connection.Listener
-
onGoAwaySent
public void onGoAwaySent(int lastStreamId, long errorCode, Buffer debugData)
Description copied from interface:Http2Connection.Listener
Called when aGOAWAY
frame was sent for the connection.If a
RuntimeException
is thrown it will be logged and not propagated. Throwing from this method is not supported and is considered a programming error.- Specified by:
onGoAwaySent
in interfaceHttp2Connection.Listener
- Parameters:
lastStreamId
- the last known stream of the remote endpoint.errorCode
- the error code, if abnormal closure.debugData
- application-defined debug data.
-
onGoAwayReceived
public void onGoAwayReceived(int lastStreamId, long errorCode, Buffer debugData)
Description copied from interface:Http2Connection.Listener
Called when aGOAWAY
was received from the remote endpoint. This event handler duplicatesHttp2FrameListener.onGoAwayRead(io.netty5.channel.ChannelHandlerContext, int, long, Buffer)
but is added here in order to simplify application logic for handlingGOAWAY
in a uniform way. An application should generally not handle both events, but if it does this method is called second, after notifying theHttp2FrameListener
.If a
RuntimeException
is thrown it will be logged and not propagated. Throwing from this method is not supported and is considered a programming error.- Specified by:
onGoAwayReceived
in interfaceHttp2Connection.Listener
- Parameters:
lastStreamId
- the last known stream of the remote endpoint.errorCode
- the error code, if abnormal closure.debugData
- application-defined debug data.
-
-