java.lang.Object
org.eclipse.jetty.http2.HTTP2Stream
- All Implemented Interfaces:
Closeable,AutoCloseable,Stream,IStream,org.eclipse.jetty.io.CyclicTimeouts.Expirable,org.eclipse.jetty.util.Attachable,org.eclipse.jetty.util.Callback,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.thread.Invocable
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Callback
org.eclipse.jetty.util.Callback.Completable, org.eclipse.jetty.util.Callback.Completing, org.eclipse.jetty.util.Callback.NestedNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.TaskNested classes/interfaces inherited from interface org.eclipse.jetty.http2.IStream
IStream.FrameListNested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Stream
Stream.Listener -
Field Summary
Fields inherited from interface org.eclipse.jetty.util.Callback
NOOPFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEYFields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking -
Constructor Summary
ConstructorsConstructorDescriptionHTTP2Stream(ISession session, int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local) HTTP2Stream(org.eclipse.jetty.util.thread.Scheduler scheduler, ISession session, int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Forcibly closes this stream.voidcommit()Marks this stream as committed.voidSends the given DATAframe.intdataSize()voiddemand(long n) DemandsnmoreDATAframes for this stream.dump()voiddump(Appendable out, String indent) booleanFail all data queued in the stream and reset demand to 0.voidgetAttribute(String key) longintgetId()longorg.eclipse.jetty.util.thread.Invocable.InvocationTypeintintvoidheaders(HeadersFrame frame, org.eclipse.jetty.util.Callback callback) Sends the given HEADERSframe.booleanisClosed()booleanbooleanisLocal()booleanbooleanisOpen()booleanbooleanisReset()booleanvoidnotIdle()Marks this stream as not idle so that theidle timeoutis postponed.voidonClose()protected voidonIdleExpired(TimeoutException timeout) voidProcesses the givenframe, belonging to this stream.voidpush(PushPromiseFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) Sends the given PUSH_PROMISEframe.removeAttribute(String key) voidreset(ResetFrame frame, org.eclipse.jetty.util.Callback callback) Sends the given RST_STREAMframe.voidsend(IStream.FrameList frameList, org.eclipse.jetty.util.Callback callback) Sends the given list of frames.voidsetAttachment(Object attachment) voidsetAttribute(String key, Object value) voidsetIdleTimeout(long idleTimeout) voidsetListener(Stream.Listener listener) voidtoString()booleanupdateClose(boolean update, CloseState.Event event) Updates the close state of this stream.intupdateRecvWindow(int delta) Updates the stream receive window by the givendelta.intupdateSendWindow(int delta) Updates the stream send window by the givendelta.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.Callback
completeWithMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelf
-
Constructor Details
-
HTTP2Stream
public HTTP2Stream(ISession session, int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local) -
HTTP2Stream
@Deprecated public HTTP2Stream(org.eclipse.jetty.util.thread.Scheduler scheduler, ISession session, int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local) Deprecated.
-
-
Method Details
-
getId
public int getId() -
getAttachment
- Specified by:
getAttachmentin interfaceorg.eclipse.jetty.util.Attachable
-
setAttachment
- Specified by:
setAttachmentin interfaceorg.eclipse.jetty.util.Attachable
-
isLocal
public boolean isLocal() -
getSession
- Specified by:
getSessionin interfaceIStream- Specified by:
getSessionin interfaceStream- Returns:
- the session this stream is associated to
-
headers
Description copied from interface:StreamSends the given HEADERS
frame.Typically used to send an HTTP response or to send the HTTP response trailers.
-
send
Description copied from interface:IStreamSends the given list of frames.
Typically used to send HTTP headers along with content and possibly trailers.
-
push
public void push(PushPromiseFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) Description copied from interface:StreamSends the given PUSH_PROMISE
frame. -
data
Description copied from interface:StreamSends the given DATA
frame. -
reset
Description copied from interface:StreamSends the given RST_STREAM
frame. -
getAttribute
- Specified by:
getAttributein interfaceStream- Parameters:
key- the attribute key- Returns:
- an arbitrary object associated with the given key to this stream or null if no object can be found for the given key.
- See Also:
-
setAttribute
- Specified by:
setAttributein interfaceStream- Parameters:
key- the attribute keyvalue- an arbitrary object to associate with the given key to this stream- See Also:
-
removeAttribute
- Specified by:
removeAttributein interfaceStream- Parameters:
key- the attribute key- Returns:
- the arbitrary object associated with the given key to this stream
- See Also:
-
isReset
public boolean isReset() -
isResetOrFailed
public boolean isResetOrFailed()- Specified by:
isResetOrFailedin interfaceIStream- Returns:
- whether this stream has been reset (locally or remotely) or has been failed
- See Also:
-
isClosed
public boolean isClosed() -
isRemotelyClosed
public boolean isRemotelyClosed()- Specified by:
isRemotelyClosedin interfaceIStream- Returns:
- whether the stream is closed remotely.
- See Also:
-
failAllData
Description copied from interface:IStreamFail all data queued in the stream and reset demand to 0.- Specified by:
failAllDatain interfaceIStream- Parameters:
x- the exception to fail the data with.- Returns:
- true if the end of the stream was reached, false otherwise.
-
isLocallyClosed
public boolean isLocallyClosed() -
commit
public void commit()Description copied from interface:IStreamMarks this stream as committed. -
isCommitted
public boolean isCommitted()- Specified by:
isCommittedin interfaceIStream- Returns:
- whether bytes for this stream have been sent to the remote peer.
- See Also:
-
dataSize
public int dataSize() -
isOpen
public boolean isOpen() -
notIdle
public void notIdle()Description copied from interface:IStreamMarks this stream as not idle so that the
idle timeoutis postponed. -
getExpireNanoTime
public long getExpireNanoTime()- Specified by:
getExpireNanoTimein interfaceorg.eclipse.jetty.io.CyclicTimeouts.Expirable
-
getIdleTimeout
public long getIdleTimeout()- Specified by:
getIdleTimeoutin interfaceStream- Returns:
- the stream idle timeout
- See Also:
-
setIdleTimeout
public void setIdleTimeout(long idleTimeout) - Specified by:
setIdleTimeoutin interfaceStream- Parameters:
idleTimeout- the stream idle timeout- See Also:
-
onIdleExpired
-
getListener
- Specified by:
getListenerin interfaceIStream- Returns:
- the
Stream.Listenerassociated with this stream - See Also:
-
setListener
- Specified by:
setListenerin interfaceIStream- Parameters:
listener- theStream.Listenerassociated with this stream- See Also:
-
process
Description copied from interface:IStreamProcesses the given
frame, belonging to this stream. -
demand
public void demand(long n) Description copied from interface:StreamDemands
nmoreDATAframes for this stream. -
updateClose
Description copied from interface:IStreamUpdates the close state of this stream.
- Specified by:
updateClosein interfaceIStream- 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
-
getSendWindow
public int getSendWindow() -
getRecvWindow
public int getRecvWindow() -
updateSendWindow
public int updateSendWindow(int delta) Description copied from interface:IStreamUpdates the stream send window by the given
delta.- Specified by:
updateSendWindowin interfaceIStream- 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:IStreamUpdates the stream receive window by the given
delta.- Specified by:
updateRecvWindowin interfaceIStream- Parameters:
delta- the delta value (positive or negative) to add to the stream receive window- Returns:
- the previous value of the stream receive window
-
close
public void close()Description copied from interface:IStreamForcibly closes this stream.
-
onClose
public void onClose() -
succeeded
public void succeeded()- Specified by:
succeededin interfaceorg.eclipse.jetty.util.Callback
-
failed
- Specified by:
failedin interfaceorg.eclipse.jetty.util.Callback
-
getInvocationType
public org.eclipse.jetty.util.thread.Invocable.InvocationType getInvocationType()- Specified by:
getInvocationTypein interfaceorg.eclipse.jetty.util.thread.Invocable
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable
-
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Throws:
IOException
-
toString
-