java.lang.Object
io.helidon.webclient.http2.Http2ClientStream
- All Implemented Interfaces:
Http2Stream,ReleasableResource
Represents an HTTP/2 client stream.
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedHttp2ClientStream(Http2ClientConnection connection, Http2Settings serverSettings, SocketContext ctx, Http2StreamConfig http2StreamConfig, Http2ClientConfig http2ClientConfig, LockingStreamIdSequence streamIdSeq) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels this client stream.voidclose()Removes the stream from underlying connection.voidCloses the resource, we cannot use nameclose, as that would conflict withAutoCloseable, as we do not want to have a checked exception thrown.ctx()Returns the socket context associated with the stream.voiddata(Http2FrameHeader header, BufferData data, boolean endOfStream) Data frame.Outbound flow control of this stream.booleanDetermines if an entity is expected.voidheaders(Http2Headers headers, boolean endOfStream) Headers received.voidpriority(Http2Priority http2Priority) Priority.read()Reads a buffer data from the stream.Reads headers from this stream.Reads an HTTP2 frame from the stream.booleanrstStream(Http2RstStream rstStream) Close the stream.voidsendPing()Sends PING frame to server.intstreamId()Stream ID.State of this stream.trailers()Future that shall be completed once trailers are received.voidwindowUpdate(Http2WindowUpdate windowUpdate) Flow control window update.voidwriteData(BufferData entityBytes, boolean endOfStream) Writes a buffer data into the stream.voidwriteHeaders(Http2Headers http2Headers, boolean endOfStream) Writes HTTP2 headers to the stream.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.helidon.webclient.api.ReleasableResource
releaseResource
-
Constructor Details
-
Http2ClientStream
protected Http2ClientStream(Http2ClientConnection connection, Http2Settings serverSettings, SocketContext ctx, Http2StreamConfig http2StreamConfig, Http2ClientConfig http2ClientConfig, LockingStreamIdSequence streamIdSeq)
-
-
Method Details
-
streamId
public int streamId()Description copied from interface:Http2StreamStream ID.- Specified by:
streamIdin interfaceHttp2Stream- Returns:
- id of this stream
-
streamState
Description copied from interface:Http2StreamState of this stream.- Specified by:
streamStatein interfaceHttp2Stream- Returns:
- state
-
headers
Description copied from interface:Http2StreamHeaders received.- Specified by:
headersin interfaceHttp2Stream- Parameters:
headers- headersendOfStream- whether these headers are the last data that would be received
-
rstStream
Description copied from interface:Http2StreamClose the stream.- Specified by:
rstStreamin interfaceHttp2Stream- Parameters:
rstStream- rst stream frame- Returns:
- true if rapid reset(rst received before any data are sent)
-
windowUpdate
Description copied from interface:Http2StreamFlow control window update.- Specified by:
windowUpdatein interfaceHttp2Stream- Parameters:
windowUpdate- window update frame
-
data
Description copied from interface:Http2StreamData frame.- Specified by:
datain interfaceHttp2Stream- Parameters:
header- frame headerdata- frame dataendOfStream- whether this is the last data that would be received
-
priority
Description copied from interface:Http2StreamPriority.- Specified by:
priorityin interfaceHttp2Stream- Parameters:
http2Priority- priority frame
-
flowControl
Description copied from interface:Http2StreamOutbound flow control of this stream.- Specified by:
flowControlin interfaceHttp2Stream- Returns:
- flow control
-
closeResource
public void closeResource()Description copied from interface:ReleasableResourceCloses the resource, we cannot use nameclose, as that would conflict withAutoCloseable, as we do not want to have a checked exception thrown.- Specified by:
closeResourcein interfaceReleasableResource
-
trailers
Future that shall be completed once trailers are received.- Returns:
- the completable future
-
hasEntity
public boolean hasEntity()Determines if an entity is expected. Set tofalsewhen an EOS flag is received.- Returns:
trueif entity expected,falseotherwise.
-
cancel
public void cancel()Cancels this client stream. -
close
public void close()Removes the stream from underlying connection. -
read
Reads a buffer data from the stream.- Returns:
- the buffer data
-
writeHeaders
Writes HTTP2 headers to the stream.- Parameters:
http2Headers- the headersendOfStream- end of stream marker
-
writeData
Writes a buffer data into the stream.- Parameters:
entityBytes- buffer dataendOfStream- end of stream marker
-
sendPing
public void sendPing()Sends PING frame to server. Can be used to check if connection is healthy. -
readHeaders
Reads headers from this stream.- Returns:
- the headers
-
ctx
Returns the socket context associated with the stream.- Returns:
- the socket context
-
readOne
Reads an HTTP2 frame from the stream.- Parameters:
pollTimeout- timeout- Returns:
- the data frame
-