- All Implemented Interfaces:
Stream,org.eclipse.jetty.io.CyclicTimeouts.Expirable,org.eclipse.jetty.util.Attachable
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface org.eclipse.jetty.http3.api.Stream
Stream.Client, Stream.Data, Stream.Server -
Constructor Summary
ConstructorsConstructorDescriptionHTTP3Stream(HTTP3Session session, org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint, boolean local) -
Method Summary
Modifier and TypeMethodDescriptionSends the given DATA frame containing some or all the bytes of the request content or of the response content.voiddemand()CausesStream.Client.Listener.onDataAvailable(Stream.Client)on the client, orStream.Server.Listener.onDataAvailable(Stream.Server)on the server, to be invoked, possibly at a later time, when the stream has data to be read.org.eclipse.jetty.quic.common.QuicStreamEndPointlonglonggetId()longbooleanbooleanisClosed()booleanisLocal()protected voidnotIdle()protected abstract voidprotected abstract voidnotifyFailure(long error, Throwable failure) protected abstract booleannotifyIdleTimeout(TimeoutException timeout) protected abstract voidnotifyTrailer(HeadersFrame frame) voidvoidvoidvoidonTrailer(HeadersFrame frame) readData()Reads request content bytes or response content bytes.voidAbruptly terminates this stream with the given error.voidsetAttachment(Object attachment) voidsetIdleTimeout(long idleTimeout) toString()trailer(HeadersFrame frame) Sends the given HEADERS frame containing the trailer headers.voidupdateClose(boolean update, boolean local) protected booleanvalidateAndUpdate(EnumSet<HTTP3Stream.FrameState> allowed, HTTP3Stream.FrameState target) protected CompletableFuture<Stream>org.eclipse.jetty.util.Promise.Completable<Stream>writeFrame(Frame frame)
-
Constructor Details
-
HTTP3Stream
public HTTP3Stream(HTTP3Session session, org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint, boolean local)
-
-
Method Details
-
getEndPoint
public org.eclipse.jetty.quic.common.QuicStreamEndPoint getEndPoint() -
getAttachment
- Specified by:
getAttachmentin interfaceorg.eclipse.jetty.util.Attachable
-
setAttachment
- Specified by:
setAttachmentin interfaceorg.eclipse.jetty.util.Attachable
-
getId
public long getId() -
getSession
- Specified by:
getSessionin interfaceStream- Returns:
- the session this stream is associated to
-
isLocal
public boolean isLocal() -
getIdleTimeout
public long getIdleTimeout() -
setIdleTimeout
public void setIdleTimeout(long idleTimeout) -
getExpireNanoTime
public long getExpireNanoTime()- Specified by:
getExpireNanoTimein interfaceorg.eclipse.jetty.io.CyclicTimeouts.Expirable
-
notIdle
protected void notIdle() -
data
Description copied from interface:StreamSends the given DATA frame containing some or all the bytes of the request content or of the response content.
- Specified by:
datain interfaceStream- Parameters:
frame- the DATA frame containing some or all the bytes of the request or of the response.- Returns:
- the
CompletableFuturethat gets notified when the frame has been sent
-
write
-
readData
Description copied from interface:StreamReads request content bytes or response content bytes.
The returned
Stream.Dataobject may benull, indicating that the end of the read side of the stream has not yet been reached, which may happen in these cases:- not all the bytes have been received so far, for example the remote peer did not send them yet, or they are in-flight
- all the bytes have been received, but there is a trailer HEADERS frame to be received to indicate the end of the read side of the stream
When the returned
Stream.Dataobject is notnull, applications must call, either immediately or later (possibly asynchronously)Stream.Data.complete()to notify the implementation that the bytes have been processed.Stream.Dataobjects may be stored away for later, asynchronous, processing (for example, to process them only when all of them have been received).- Specified by:
readDatain interfaceStream- Returns:
- a
Stream.Dataobject containing the request bytes or the response bytes, or null if no bytes are available - See Also:
-
demand
public void demand()Description copied from interface:StreamCauses
Stream.Client.Listener.onDataAvailable(Stream.Client)on the client, orStream.Server.Listener.onDataAvailable(Stream.Server)on the server, to be invoked, possibly at a later time, when the stream has data to be read.This method is idempotent: calling it when there already is an outstanding demand to invoke
onDataAvailable(Stream)is a no-operation.The thread invoking this method may invoke directly
onDataAvailable(Stream), unless another thread that must invokeonDataAvailable(Stream)notices the outstanding demand first.When all bytes have been read (via
Stream.readData()), further invocations of this method are a no-operation.It is always guaranteed that invoking this method from within
onDataAvailable(Stream)will not cause aStackOverflowError. -
trailer
Description copied from interface:StreamSends the given HEADERS frame containing the trailer headers.
- Specified by:
trailerin interfaceStream- Parameters:
frame- the HEADERS frame containing the trailer headers- Returns:
- the
CompletableFuturethat gets notified when the frame has been sent
-
hasDemand
public boolean hasDemand() -
onData
-
onDataAvailable
public void onDataAvailable() -
notifyDataAvailable
protected abstract void notifyDataAvailable() -
onTrailer
-
notifyTrailer
-
notifyIdleTimeout
-
onFailure
-
notifyFailure
-
validateAndUpdate
protected boolean validateAndUpdate(EnumSet<HTTP3Stream.FrameState> allowed, HTTP3Stream.FrameState target) -
writeFrame
-
isClosed
public boolean isClosed() -
updateClose
public void updateClose(boolean update, boolean local) -
reset
Description copied from interface:StreamAbruptly terminates this stream with the given error.
-
toString
-