java.lang.Object
io.helidon.webclient.http2.Http2ClientStream
- All Implemented Interfaces:
Http2Stream
,ReleasableResource
Represents an HTTP2 client stream. This class is not intended to be used by
applications, it is only public internally within Helidon.
-
Constructor Summary
ModifierConstructorDescriptionprotected
Http2ClientStream
(Http2ClientConnection connection, Http2Settings serverSettings, SocketContext ctx, Http2StreamConfig http2StreamConfig, Http2ClientConfig http2ClientConfig, LockingStreamIdSequence streamIdSeq) -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Cancels this client stream.void
close()
Removes the stream from underlying connection.void
Closes 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.void
data
(Http2FrameHeader header, BufferData data, boolean endOfStream) Data frame.Outbound flow control of this stream.boolean
Determines if an entity is expected.void
headers
(Http2Headers headers, boolean endOfStream) Headers received.void
priority
(Http2Priority http2Priority) Priority.read()
Reads a buffer data from the stream.Reads headers from this stream.Reads an HTTP2 frame from the stream.boolean
rstStream
(Http2RstStream rstStream) Close the stream.void
sendPing()
Sends PING frame to server.int
streamId()
Stream ID.State of this stream.trailers()
Future that shall be completed once trailers are received.void
windowUpdate
(Http2WindowUpdate windowUpdate) Flow control window update.void
writeData
(BufferData entityBytes, boolean endOfStream) Writes a buffer data into the stream.void
writeHeaders
(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, wait
Methods 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:Http2Stream
Stream ID.- Specified by:
streamId
in interfaceHttp2Stream
- Returns:
- id of this stream
-
streamState
Description copied from interface:Http2Stream
State of this stream.- Specified by:
streamState
in interfaceHttp2Stream
- Returns:
- state
-
headers
Description copied from interface:Http2Stream
Headers received.- Specified by:
headers
in interfaceHttp2Stream
- Parameters:
headers
- headersendOfStream
- whether these headers are the last data that would be received
-
rstStream
Description copied from interface:Http2Stream
Close the stream.- Specified by:
rstStream
in interfaceHttp2Stream
- Parameters:
rstStream
- rst stream frame- Returns:
- true if rapid reset(rst received before any data are sent)
-
windowUpdate
Description copied from interface:Http2Stream
Flow control window update.- Specified by:
windowUpdate
in interfaceHttp2Stream
- Parameters:
windowUpdate
- window update frame
-
data
Description copied from interface:Http2Stream
Data frame.- Specified by:
data
in interfaceHttp2Stream
- Parameters:
header
- frame headerdata
- frame dataendOfStream
- whether this is the last data that would be received
-
priority
Description copied from interface:Http2Stream
Priority.- Specified by:
priority
in interfaceHttp2Stream
- Parameters:
http2Priority
- priority frame
-
flowControl
Description copied from interface:Http2Stream
Outbound flow control of this stream.- Specified by:
flowControl
in interfaceHttp2Stream
- Returns:
- flow control
-
closeResource
public void closeResource()Description copied from interface:ReleasableResource
Closes the resource, we cannot use nameclose
, as that would conflict withAutoCloseable
, as we do not want to have a checked exception thrown.- Specified by:
closeResource
in 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 tofalse
when an EOS flag is received.- Returns:
true
if entity expected,false
otherwise.
-
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
-