Class HTTP2Stream

    • Constructor Detail

      • HTTP2Stream

        public HTTP2Stream​(org.eclipse.jetty.util.thread.Scheduler scheduler,
                           ISession session,
                           int streamId,
                           boolean local)
    • Method Detail

      • getId

        public int getId()
        Specified by:
        getId in interface Stream
        Returns:
        the stream unique id
      • isLocal

        public boolean isLocal()
        Specified by:
        isLocal in interface IStream
        Returns:
        whether this stream is local or remote
      • headers

        public void headers​(HeadersFrame frame,
                            org.eclipse.jetty.util.Callback callback)
        Description copied from interface: Stream

        Sends the given HEADERS frame representing a HTTP response.

        Specified by:
        headers in interface Stream
        Parameters:
        frame - the HEADERS frame to send
        callback - the callback that gets notified when the frame has been sent
      • push

        public void push​(PushPromiseFrame frame,
                         org.eclipse.jetty.util.Promise<Stream> promise,
                         Stream.Listener listener)
        Description copied from interface: Stream

        Sends the given PUSH_PROMISE frame.

        Specified by:
        push in interface Stream
        Parameters:
        frame - the PUSH_PROMISE frame to send
        promise - the promise that gets notified of the pushed stream creation
        listener - the listener that gets notified of stream events
      • data

        public void data​(DataFrame frame,
                         org.eclipse.jetty.util.Callback callback)
        Description copied from interface: Stream

        Sends the given DATA frame.

        Specified by:
        data in interface Stream
        Parameters:
        frame - the DATA frame to send
        callback - the callback that gets notified when the frame has been sent
      • reset

        public void reset​(ResetFrame frame,
                          org.eclipse.jetty.util.Callback callback)
        Description copied from interface: Stream

        Sends the given RST_STREAM frame.

        Specified by:
        reset in interface Stream
        Parameters:
        frame - the RST_FRAME to send
        callback - the callback that gets notified when the frame has been sent
      • isReset

        public boolean isReset()
        Specified by:
        isReset in interface Stream
        Returns:
        whether this stream has been reset
      • isClosed

        public boolean isClosed()
        Specified by:
        isClosed in interface Stream
        Returns:
        whether this stream is closed, both locally and remotely.
      • isRemotelyClosed

        public boolean isRemotelyClosed()
      • isLocallyClosed

        public boolean isLocallyClosed()
      • isOpen

        public boolean isOpen()
        Specified by:
        isOpen in class org.eclipse.jetty.io.IdleTimeout
      • onIdleExpired

        protected void onIdleExpired​(TimeoutException timeout)
        Specified by:
        onIdleExpired in class org.eclipse.jetty.io.IdleTimeout
      • process

        public void process​(Frame frame,
                            org.eclipse.jetty.util.Callback callback)
        Description copied from interface: IStream

        Processes the given frame, belonging to this stream.

        Specified by:
        process in interface IStream
        Parameters:
        frame - the frame to process
        callback - the callback to complete when frame has been processed
      • updateClose

        public boolean updateClose​(boolean update,
                                   boolean local)
        Description copied from interface: IStream

        Updates the close state of this stream.

        Specified by:
        updateClose in interface IStream
        Parameters:
        update - whether to update the close state
        local - whether the update comes from a local operation (such as sending a frame that ends the stream) or a remote operation (such as receiving a frame
        Returns:
        whether the stream has been fully closed by this invocation
      • getSendWindow

        public int getSendWindow()
      • getRecvWindow

        public int getRecvWindow()
      • updateSendWindow

        public int updateSendWindow​(int delta)
        Description copied from interface: IStream

        Updates the stream send window by the given delta.

        Specified by:
        updateSendWindow in interface IStream
        Parameters:
        delta - the delta value (positive or negative) to add to the stream send window
        Returns:
        the previous value of the stream send window
      • updateRecvWindow

        public int updateRecvWindow​(int delta)
        Description copied from interface: IStream

        Updates the stream receive window by the given delta.

        Specified by:
        updateRecvWindow in interface IStream
        Parameters:
        delta - the delta value (positive or negative) to add to the stream receive window
        Returns:
        the previous value of the stream receive window