Class HTTP3Stream
- All Implemented Interfaces:
 Stream, CyclicTimeouts.Expirable, Attachable
- 
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static enumDefines the state of the stream for received frames,Nested classes/interfaces inherited from interface Stream
Stream.Client, Stream.Server - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoiddata(DataFrame frame, Promise.Invocable<Stream> promise) Sends the given DATA frame containing some or all the bytes of the request content or of the response content.voiddemand()Demands moreDATAframes for this stream.voiddisconnect(long appErrorCode, Throwable failure, Promise.Invocable<Stream> promise) Abruptly terminates this stream with the given error.longReturns the expiration time in nanoseconds.longgetId()Get the stream id.longGet the session this stream is associated to.booleanbooleanisClosed()booleanisLocal()protected voidnotIdle()protected abstract voidnotifyDataAvailable(boolean immediate) abstract voidnotifyFailure(long error, Throwable failure) protected abstract voidnotifyIdleTimeout(TimeoutException timeout, Promise<Boolean> promise) protected abstract voidnotifyTrailer(HeadersFrame frame) voidvoidvoidonHeaders(HeadersFrame frame) voidonTrailer(HeadersFrame frame) read()Reads request content bytes or response content bytes.voidsetAttachment(Object attachment) Attaches the given object for later retrieval.voidsetIdleTimeout(long idleTimeout) toString()voidtrailer(HeadersFrame frame, Promise.Invocable<Stream> promise) Sends the given HEADERS frame containing the trailer headers.voidupdateClose(boolean update, boolean local) protected voidvalidateAndUpdate(EnumSet<HTTP3Stream.FrameState> allowed, HTTP3Stream.FrameState target) protected voidwrite(Frame frame, Promise.Invocable<Stream> promise) voidwriteFrame(Frame frame, Promise.Invocable<Stream> promise)  
- 
Constructor Details
- 
HTTP3Stream
 
 - 
 - 
Method Details
- 
getStreamEndPoint
 - 
getAttachment
- Specified by:
 getAttachmentin interfaceAttachable- Returns:
 - the object attached to this instance
 - See Also:
 
 - 
setAttachment
Description copied from interface:AttachableAttaches the given object for later retrieval.- Specified by:
 setAttachmentin interfaceAttachable- Parameters:
 attachment- the object to attach
 - 
getId
 - 
getSession
Description copied from interface:StreamGet the session this stream is associated to.- 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()Description copied from interface:CyclicTimeouts.ExpirableReturns the expiration time in nanoseconds.
The value to return must be calculated taking into account the current nanoTime, for example:
expireNanoTime = NanoTime.now() + timeoutNanosReturning
Long.MAX_VALUEindicates that this entity does not expire.- Specified by:
 getExpireNanoTimein interfaceCyclicTimeouts.Expirable- Returns:
 - the expiration time in nanoseconds, or 
Long.MAX_VALUEif this entity does not expire 
 - 
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.promise- thePromise.Invocablethat gets notified when the frame has been sent
 - 
write
 - 
read
Description copied from interface:StreamReads request content bytes or response content bytes.
The returned
Content.Chunkobject 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
Content.Chunkobject is notnull, applications must call, either immediately or later (possibly asynchronously)Retainable.release()to notify the implementation that the bytes have been processed.Content.Chunkobjects may be stored away for later, asynchronous, processing (for example, to process them only when all of them have been received).- Specified by:
 readin interfaceStream- Returns:
 - a 
Content.Chunkobject containing the request bytes or the response bytes or a failure, or null if no bytes are available - See Also:
 
 - 
demand
public void demand()Description copied from interface:StreamDemands more
DATAframes for this stream.Calling this method causes
Stream.Client.Listener.onDataAvailable(Stream.Client, boolean)on the client, orStream.Server.Listener.onDataAvailable(Stream.Server, boolean)on the server, to be invoked, possibly at a later time, when the stream has data to be read, but also when the stream has reached EOF.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.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 headerspromise- thePromise.Invocablethat gets notified when the frame has been sent
 - 
hasDemand
public boolean hasDemand() - 
onHeaders
 - 
onData
 - 
notifyDataAvailable
protected abstract void notifyDataAvailable(boolean immediate)  - 
onTrailer
 - 
notifyTrailer
 - 
notifyIdleTimeout
 - 
onFailure
 - 
notifyFailure
 - 
validateAndUpdate
protected void validateAndUpdate(EnumSet<HTTP3Stream.FrameState> allowed, HTTP3Stream.FrameState target)  - 
writeFrame
 - 
isClosed
public boolean isClosed() - 
updateClose
public void updateClose(boolean update, boolean local)  - 
disconnect
Description copied from interface:StreamAbruptly terminates this stream with the given error.
This method removes this stream from its session and then terminates the QUIC stream, via
STOP_SENDINGandRESETframes, if necessary.- Specified by:
 disconnectin interfaceStream- Parameters:
 appErrorCode- the error codefailure- the failure that caused the close of the stream, if anypromise- thePromise.Invocablethat gets notified when the disconnect is complete
 - 
toString
 
 -