Top Description Inners Methods
io.netty5.handler.codec.http2

public Interface Http2Stream

Known Direct Implementers
io.netty5.handler.codec.http2.DefaultHttp2Connection.DefaultStream
Annotations
@UnstableApi
Imports
io.netty5.util.internal.UnstableApi

A single stream within an HTTP2 connection. Streams are compared to each other by priority.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Http2Stream.State

The allowed states of an HTTP2 stream.

Method Summary

Modifier and TypeMethod and Description
public Http2Stream
close()

Closes the stream.

public Http2Stream
closeLocalSide()

Closes the local side of this stream.

public Http2Stream
closeRemoteSide()

Closes the remote side of this stream.

public <V> V
getProperty(Http2Connection.PropertyKey key)

Returns application-defined data if any was associated with this stream.

public Http2Stream
headersReceived(boolean
true if the headers contain an informational status code (for responses only).
isInformational
)

Indicates that headers have been received.

public Http2Stream
headersSent(boolean
true if the headers contain an informational status code (for responses only).
isInformational
)

Indicates that headers have been sent to the remote endpoint on this stream.

public int
id()

Gets the unique identifier for this stream within the connection.

public boolean
isHeadersReceived()

Indicates whether or not the initial headers have been received.

public boolean
isHeadersSent()

Indicates whether or not headers were sent to the remote endpoint.

public boolean
isPushPromiseSent()

Indicates whether or not a push promise was sent to the remote endpoint.

public boolean
isResetSent()

Indicates whether a RST_STREAM frame has been sent from the local endpoint for this stream.

public boolean
isTrailersReceived()

Indicates whether or not the trailers have been received.

public boolean
isTrailersSent()

Indicates whether or not trailers were sent to the remote endpoint.

public Http2Stream
open(boolean halfClosed)

Opens this stream, making it available via Http2Connection#forEachActiveStream(Http2StreamVisitor) and transition state to:

public Http2Stream
pushPromiseSent()

Indicates that a push promise was sent to the remote endpoint.

public <V> V
removeProperty(Http2Connection.PropertyKey key)

Returns and removes application-defined data if any was associated with this stream.

public Http2Stream
resetSent()

Sets the flag indicating that a RST_STREAM frame has been sent from the local endpoint for this stream.

public <V> V

Returns:

The value that was previously associated with key, or null if there was none.
setProperty
(Http2Connection.PropertyKey key, V value)

Associates the application-defined data with this stream.

public Http2Stream.State
state()

Gets the state of this stream.

Method Detail

closeback to summary
public Http2Stream close()

Closes the stream.

closeLocalSideback to summary
public Http2Stream closeLocalSide()

Closes the local side of this stream. If this makes the stream closed, the child is closed as well.

closeRemoteSideback to summary
public Http2Stream closeRemoteSide()

Closes the remote side of this stream. If this makes the stream closed, the child is closed as well.

getPropertyback to summary
public <V> V getProperty(Http2Connection.PropertyKey key)

Returns application-defined data if any was associated with this stream.

headersReceivedback to summary
public Http2Stream headersReceived(boolean isInformational)

Indicates that headers have been received. The first call to this method would be for the initial headers (see isHeadersReceived()} and the second call would indicate the trailers (see isTrailersReceived()).

Parameters
isInformational:boolean

true if the headers contain an informational status code (for responses only).

headersSentback to summary
public Http2Stream headersSent(boolean isInformational)

Indicates that headers have been sent to the remote endpoint on this stream. The first call to this method would be for the initial headers (see isHeadersSent()} and the second call would indicate the trailers (see isTrailersReceived()).

Parameters
isInformational:boolean

true if the headers contain an informational status code (for responses only).

idback to summary
public int id()

Gets the unique identifier for this stream within the connection.

isHeadersReceivedback to summary
public boolean isHeadersReceived()

Indicates whether or not the initial headers have been received.

isHeadersSentback to summary
public boolean isHeadersSent()

Indicates whether or not headers were sent to the remote endpoint.

isPushPromiseSentback to summary
public boolean isPushPromiseSent()

Indicates whether or not a push promise was sent to the remote endpoint.

isResetSentback to summary
public boolean isResetSent()

Indicates whether a RST_STREAM frame has been sent from the local endpoint for this stream.

isTrailersReceivedback to summary
public boolean isTrailersReceived()

Indicates whether or not the trailers have been received.

isTrailersSentback to summary
public boolean isTrailersSent()

Indicates whether or not trailers were sent to the remote endpoint.

openback to summary
public Http2Stream open(boolean halfClosed) throws Http2Exception

Opens this stream, making it available via Http2Connection#forEachActiveStream(Http2StreamVisitor) and transition state to:

pushPromiseSentback to summary
public Http2Stream pushPromiseSent()

Indicates that a push promise was sent to the remote endpoint.

removePropertyback to summary
public <V> V removeProperty(Http2Connection.PropertyKey key)

Returns and removes application-defined data if any was associated with this stream.

resetSentback to summary
public Http2Stream resetSent()

Sets the flag indicating that a RST_STREAM frame has been sent from the local endpoint for this stream. This does not affect the stream state.

setPropertyback to summary
public <V> V setProperty(Http2Connection.PropertyKey key, V value)

Associates the application-defined data with this stream.

Returns:V

The value that was previously associated with key, or null if there was none.

stateback to summary
public Http2Stream.State state()

Gets the state of this stream.

io.netty5.handler.codec.http2 back to summary

public final Enum Http2Stream.State

extends Enum<Http2Stream.State>
Class Inheritance

The allowed states of an HTTP2 stream.

Field Summary

Modifier and TypeField and Description
public static final Http2Stream.State
public static final Http2Stream.State
public static final Http2Stream.State
public static final Http2Stream.State
private final boolean
public static final Http2Stream.State
private final boolean
public static final Http2Stream.State
public static final Http2Stream.State

Constructor Summary

AccessConstructor and Description
private
State(boolean localSideOpen, boolean remoteSideOpen)

Method Summary

Modifier and TypeMethod and Description
public boolean
localSideOpen()

Indicates whether the local side of this stream is open (i.e. the state is either State#OPEN or State#HALF_CLOSED_REMOTE).

public boolean
remoteSideOpen()

Indicates whether the remote side of this stream is open (i.e. the state is either State#OPEN or State#HALF_CLOSED_LOCAL).

public static Http2Stream.State
public static Http2Stream.State[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CLOSEDback to summary
public static final Http2Stream.State CLOSED
HALF_CLOSED_LOCALback to summary
public static final Http2Stream.State HALF_CLOSED_LOCAL
HALF_CLOSED_REMOTEback to summary
public static final Http2Stream.State HALF_CLOSED_REMOTE
IDLEback to summary
public static final Http2Stream.State IDLE
localSideOpenback to summary
private final boolean localSideOpen
OPENback to summary
public static final Http2Stream.State OPEN
remoteSideOpenback to summary
private final boolean remoteSideOpen
RESERVED_LOCALback to summary
public static final Http2Stream.State RESERVED_LOCAL
RESERVED_REMOTEback to summary
public static final Http2Stream.State RESERVED_REMOTE

Constructor Detail

Stateback to summary
private State(boolean localSideOpen, boolean remoteSideOpen)

Method Detail

localSideOpenback to summary
public boolean localSideOpen()

Indicates whether the local side of this stream is open (i.e. the state is either State#OPEN or State#HALF_CLOSED_REMOTE).

remoteSideOpenback to summary
public boolean remoteSideOpen()

Indicates whether the remote side of this stream is open (i.e. the state is either State#OPEN or State#HALF_CLOSED_LOCAL).

valueOfback to summary
public static Http2Stream.State valueOf(String name)
valuesback to summary
public static Http2Stream.State[] values()