Package org.eclipse.jetty.http2
Interface IStream
- All Superinterfaces:
Attachable
,AutoCloseable
,Closeable
,Stream
- All Known Implementing Classes:
HTTP2Stream
The SPI interface for implementing an HTTP/2 stream.
This class extends Stream
by adding the methods required to
implement the HTTP/2 stream functionalities.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
An ordered list of frames belonging to the same stream.Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Stream
Stream.Listener
-
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Forcibly closes this stream.void
commit()
Marks this stream as committed.int
dataSize()
boolean
Fail all data queued in the stream and reset demand to 0.boolean
boolean
isLocal()
boolean
boolean
void
notIdle()
Marks this stream as not idle so that theidle timeout
is postponed.void
Processes the givenframe
, belonging to this stream.void
send
(IStream.FrameList frameList, Callback callback) Sends the given list of frames.void
setListener
(Stream.Listener listener) boolean
updateClose
(boolean update, CloseState.Event event) Updates the close state of this stream.int
updateRecvWindow
(int delta) Updates the stream receive window by the givendelta
.int
updateSendWindow
(int delta) Updates the stream send window by the givendelta
.Methods inherited from interface org.eclipse.jetty.util.Attachable
getAttachment, setAttachment
Methods inherited from interface org.eclipse.jetty.http2.api.Stream
data, data, demand, getAttribute, getId, getIdleTimeout, headers, headers, isClosed, isReset, push, push, removeAttribute, reset, setAttribute, setIdleTimeout
-
Method Details
-
isLocal
boolean isLocal()- Returns:
- whether this stream is local or remote
-
getSession
ISession getSession()- Specified by:
getSession
in interfaceStream
- Returns:
- the session this stream is associated to
-
getListener
Stream.Listener getListener()- Returns:
- the
Stream.Listener
associated with this stream - See Also:
-
setListener
- Parameters:
listener
- theStream.Listener
associated with this stream- See Also:
-
send
Sends the given list of frames.
Typically used to send HTTP headers along with content and possibly trailers.
- Parameters:
frameList
- the list of frames to sendcallback
- the callback that gets notified when the frames have been sent
-
process
Processes the given
frame
, belonging to this stream.- Parameters:
frame
- the frame to processcallback
- the callback to complete when frame has been processed
-
updateClose
Updates the close state of this stream.
- Parameters:
update
- whether to update the close stateevent
- the event that caused the close state update- Returns:
- whether the stream has been fully closed by this invocation
-
close
void close()Forcibly closes this stream.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
updateSendWindow
int updateSendWindow(int delta) Updates the stream send window by the given
delta
.- 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
int updateRecvWindow(int delta) Updates the stream receive window by the given
delta
.- Parameters:
delta
- the delta value (positive or negative) to add to the stream receive window- Returns:
- the previous value of the stream receive window
-
notIdle
void notIdle()Marks this stream as not idle so that the
idle timeout
is postponed. -
isRemotelyClosed
boolean isRemotelyClosed()- Returns:
- whether the stream is closed remotely.
- See Also:
-
failAllData
Fail all data queued in the stream and reset demand to 0.- Parameters:
x
- the exception to fail the data with.- Returns:
- true if the end of the stream was reached, false otherwise.
-
isResetOrFailed
boolean isResetOrFailed()- Returns:
- whether this stream has been reset (locally or remotely) or has been failed
- See Also:
-
commit
void commit()Marks this stream as committed.- See Also:
-
isCommitted
boolean isCommitted()- Returns:
- whether bytes for this stream have been sent to the remote peer.
- See Also:
-
dataSize
int dataSize()- Returns:
- the size of the DATA frame queue
-