Interface Http2LifecycleManager

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      void closeStream​(Http2Stream stream, io.netty5.util.concurrent.Future<Void> future)
      Closes and deactivates the given stream.
      void closeStreamLocal​(Http2Stream stream, io.netty5.util.concurrent.Future<Void> future)
      Closes the local side of the stream.
      void closeStreamRemote​(Http2Stream stream, io.netty5.util.concurrent.Future<Void> future)
      Closes the remote side of the stream.
      io.netty5.util.concurrent.Future<Void> goAway​(io.netty5.channel.ChannelHandlerContext ctx, int lastStreamId, long errorCode, io.netty5.buffer.Buffer debugData)
      Prevents the peer from creating streams and close the connection if errorCode is not Http2Error.NO_ERROR.
      void onError​(io.netty5.channel.ChannelHandlerContext ctx, boolean outbound, Throwable cause)
      Processes the given error.
      io.netty5.util.concurrent.Future<Void> resetStream​(io.netty5.channel.ChannelHandlerContext ctx, int streamId, long errorCode)
      Ensure the stream identified by streamId is reset.
    • Method Detail

      • closeStream

        void closeStream​(Http2Stream stream,
                         io.netty5.util.concurrent.Future<Void> future)
        Closes and deactivates the given stream. A listener is also attached to future and upon completion the underlying channel will be closed if Http2Connection.numActiveStreams() is 0.
        Parameters:
        stream - the stream to be closed and deactivated.
        future - when completed if Http2Connection.numActiveStreams() is 0 then the underlying channel will be closed.
      • resetStream

        io.netty5.util.concurrent.Future<Void> resetStream​(io.netty5.channel.ChannelHandlerContext ctx,
                                                           int streamId,
                                                           long errorCode)
        Ensure the stream identified by streamId is reset. If our local state does not indicate the stream has been reset yet then a RST_STREAM will be sent to the peer. If our local state indicates the stream has already been reset then the return status will indicate success without sending anything to the peer.
        Parameters:
        ctx - The context used for communication and buffer allocation if necessary.
        streamId - The identifier of the stream to reset.
        errorCode - Justification as to why this stream is being reset. See Http2Error.
        Returns:
        Will be considered successful when the connection and stream state has been updated, and a RST_STREAM frame has been sent to the peer. If the stream state has already been updated and a RST_STREAM frame has been sent then the return status may indicate success immediately.
      • goAway

        io.netty5.util.concurrent.Future<Void> goAway​(io.netty5.channel.ChannelHandlerContext ctx,
                                                      int lastStreamId,
                                                      long errorCode,
                                                      io.netty5.buffer.Buffer debugData)
        Prevents the peer from creating streams and close the connection if errorCode is not Http2Error.NO_ERROR. After this call the peer is not allowed to create any new streams and the local endpoint will be limited to creating streams with stream identifier <= lastStreamId. This may result in sending a GO_AWAY frame (assuming we have not already sent one with Last-Stream-ID <= lastStreamId), or may just return success if a GO_AWAY has previously been sent.
        Parameters:
        ctx - The context used for communication and buffer allocation if necessary.
        lastStreamId - The last stream that the local endpoint is claiming it will accept.
        errorCode - The rational as to why the connection is being closed. See Http2Error.
        debugData - For diagnostic purposes (carries no semantic value).
        Returns:
        Will be considered successful when the connection and stream state has been updated, and a GO_AWAY frame has been sent to the peer. If the stream state has already been updated and a GO_AWAY frame has been sent then the return status may indicate success immediately.
      • onError

        void onError​(io.netty5.channel.ChannelHandlerContext ctx,
                     boolean outbound,
                     Throwable cause)
        Processes the given error.
        Parameters:
        ctx - The context used for communication and buffer allocation if necessary.
        outbound - true if the error was caused by an outbound operation and so the corresponding Promise was failed as well.
        cause - the error.