java.lang.Object
io.helidon.webclient.http2.Http2ClientStream
- All Implemented Interfaces:
Http2Stream,io.helidon.webclient.api.ReleasableResource
public class Http2ClientStream
extends Object
implements Http2Stream, io.helidon.webclient.api.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
ConstructorsModifierConstructorDescriptionprotectedHttp2ClientStream(Http2ClientConnection connection, Http2Settings serverSettings, io.helidon.common.socket.SocketContext ctx, Http2StreamConfig http2StreamConfig, Http2ClientConfig http2ClientConfig, LockingStreamIdSequence streamIdSeq) -
Method Summary
Modifier and TypeMethodDescriptionvoidcancel()Cancels this client stream.voidclose()Removes the stream from underlying connection.voidio.helidon.common.socket.SocketContextctx()Returns the socket context associated with the stream.voiddata(Http2FrameHeader header, io.helidon.common.buffers.BufferData data, boolean endOfStream) booleanDetermines if an entity is expected.voidheaders(Http2Headers headers, boolean endOfStream) voidpriority(Http2Priority http2Priority) io.helidon.common.buffers.BufferDataread()Reads a buffer data from the stream.Reads headers from this stream.Reads an HTTP2 frame from the stream.booleanrstStream(Http2RstStream rstStream) voidsendPing()Sends PING frame to server.intstreamId()CompletableFuture<io.helidon.http.Headers> trailers()Future that shall be completed once trailers are received.voidwindowUpdate(Http2WindowUpdate windowUpdate) voidwriteData(io.helidon.common.buffers.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, io.helidon.common.socket.SocketContext ctx, Http2StreamConfig http2StreamConfig, Http2ClientConfig http2ClientConfig, LockingStreamIdSequence streamIdSeq)
-
-
Method Details
-
streamId
public int streamId()- Specified by:
streamIdin interfaceHttp2Stream
-
streamState
- Specified by:
streamStatein interfaceHttp2Stream
-
headers
- Specified by:
headersin interfaceHttp2Stream
-
rstStream
- Specified by:
rstStreamin interfaceHttp2Stream
-
windowUpdate
- Specified by:
windowUpdatein interfaceHttp2Stream
-
data
public void data(Http2FrameHeader header, io.helidon.common.buffers.BufferData data, boolean endOfStream) - Specified by:
datain interfaceHttp2Stream
-
priority
- Specified by:
priorityin interfaceHttp2Stream
-
flowControl
- Specified by:
flowControlin interfaceHttp2Stream
-
closeResource
public void closeResource()- Specified by:
closeResourcein interfaceio.helidon.webclient.api.ReleasableResource
-
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
public io.helidon.common.buffers.BufferData 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
public void writeData(io.helidon.common.buffers.BufferData entityBytes, boolean endOfStream) 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
public io.helidon.common.socket.SocketContext 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
-