Class Http3ServerPushStreamManager


  • public final class Http3ServerPushStreamManager
    extends Object
    A manager for push streams for a server. New push streams can be initiated using the various newPushStream methods. It is required to add the ChannelHandler returned from controlStreamListener() to the QuicChannel associated with this manager.
    • Constructor Summary

      Constructors 
      Constructor Description
      Http3ServerPushStreamManager​(io.netty.handler.codec.quic.QuicChannel channel)
      Creates a new instance.
      Http3ServerPushStreamManager​(io.netty.handler.codec.quic.QuicChannel channel, int initialPushStreamsCountHint)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      io.netty.channel.ChannelInboundHandler controlStreamListener()
      A ChannelInboundHandler to be added to the QuicChannel associated with this Http3ServerPushStreamManager to listen to control stream frames.
      boolean isPushAllowed()
      Returns true if server push is allowed at this point.
      io.netty.util.concurrent.Future<io.netty.handler.codec.quic.QuicStreamChannel> newPushStream​(long pushId, @Nullable io.netty.channel.ChannelHandler handler)
      Returns a new HTTP/3 push-stream that will use the given ChannelHandler to dispatch Http3PushStreamFrames too.
      void newPushStream​(long pushId, @Nullable io.netty.channel.ChannelHandler handler, io.netty.util.concurrent.Promise<io.netty.handler.codec.quic.QuicStreamChannel> promise)
      Returns a new HTTP/3 push-stream that will use the given ChannelHandler to dispatch Http3PushStreamFrames too.
      void newPushStream​(long pushId, @Nullable io.netty.channel.ChannelHandler handler, UnaryOperator<io.netty.handler.codec.quic.QuicStreamChannelBootstrap> bootstrapConfigurator, io.netty.util.concurrent.Promise<io.netty.handler.codec.quic.QuicStreamChannel> promise)
      Returns a new HTTP/3 push-stream that will use the given ChannelHandler to dispatch Http3PushStreamFrames too.
      long reserveNextPushId()
      Reserves a push ID to be used to create a new push stream subsequently.
    • Constructor Detail

      • Http3ServerPushStreamManager

        public Http3ServerPushStreamManager​(io.netty.handler.codec.quic.QuicChannel channel)
        Creates a new instance.
        Parameters:
        channel - for which this manager is created.
      • Http3ServerPushStreamManager

        public Http3ServerPushStreamManager​(io.netty.handler.codec.quic.QuicChannel channel,
                                            int initialPushStreamsCountHint)
        Creates a new instance.
        Parameters:
        channel - for which this manager is created.
        initialPushStreamsCountHint - a hint for the number of push streams that may be created.
    • Method Detail

      • isPushAllowed

        public boolean isPushAllowed()
        Returns true if server push is allowed at this point.
        Returns:
        true if server push is allowed at this point.
      • reserveNextPushId

        public long reserveNextPushId()
        Reserves a push ID to be used to create a new push stream subsequently. A push ID can only be used to create exactly one push stream.
        Returns:
        Next push ID.
        Throws:
        IllegalStateException - If it is not allowed to create any more push streams on the associated QuicChannel. Use isPushAllowed() to check if server push is allowed.
      • newPushStream

        public io.netty.util.concurrent.Future<io.netty.handler.codec.quic.QuicStreamChannel> newPushStream​(long pushId,
                                                                                                            @Nullable
                                                                                                            @Nullable io.netty.channel.ChannelHandler handler)
        Returns a new HTTP/3 push-stream that will use the given ChannelHandler to dispatch Http3PushStreamFrames too. The needed HTTP/3 codecs are automatically added to the pipeline as well.
        Parameters:
        pushId - for the push stream. This MUST be obtained using reserveNextPushId().
        handler - the ChannelHandler to add. Can be null.
        Returns:
        the Future that will be notified once the push-stream was opened.
      • newPushStream

        public void newPushStream​(long pushId,
                                  @Nullable
                                  @Nullable io.netty.channel.ChannelHandler handler,
                                  io.netty.util.concurrent.Promise<io.netty.handler.codec.quic.QuicStreamChannel> promise)
        Returns a new HTTP/3 push-stream that will use the given ChannelHandler to dispatch Http3PushStreamFrames too. The needed HTTP/3 codecs are automatically added to the pipeline as well.
        Parameters:
        pushId - for the push stream. This MUST be obtained using reserveNextPushId().
        handler - the ChannelHandler to add. Can be null.
        promise - to indicate creation of the push stream.
      • newPushStream

        public void newPushStream​(long pushId,
                                  @Nullable
                                  @Nullable io.netty.channel.ChannelHandler handler,
                                  UnaryOperator<io.netty.handler.codec.quic.QuicStreamChannelBootstrap> bootstrapConfigurator,
                                  io.netty.util.concurrent.Promise<io.netty.handler.codec.quic.QuicStreamChannel> promise)
        Returns a new HTTP/3 push-stream that will use the given ChannelHandler to dispatch Http3PushStreamFrames too. The needed HTTP/3 codecs are automatically added to the pipeline as well.
        Parameters:
        pushId - for the push stream. This MUST be obtained using reserveNextPushId().
        handler - the ChannelHandler to add. Can be null.
        bootstrapConfigurator - UnaryOperator to configure the QuicStreamChannelBootstrap used.
        promise - to indicate creation of the push stream.
      • controlStreamListener

        public io.netty.channel.ChannelInboundHandler controlStreamListener()
        A ChannelInboundHandler to be added to the QuicChannel associated with this Http3ServerPushStreamManager to listen to control stream frames.
        Returns:
        ChannelInboundHandler to be added to the QuicChannel associated with this Http3ServerPushStreamManager to listen to control stream frames.