Package io.netty.handler.codec.http2
Interface Http2Stream
-
public interface Http2StreamA single stream within an HTTP2 connection. Streams are compared to each other by priority.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classHttp2Stream.StateThe allowed states of an HTTP2 stream.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Http2Streamclose()Closes the stream.Http2StreamcloseLocalSide()Closes the local side of this stream.Http2StreamcloseRemoteSide()Closes the remote side of this stream.<V> VgetProperty(Http2Connection.PropertyKey key)Returns application-defined data if any was associated with this stream.Http2StreamheadersReceived(boolean isInformational)Indicates that headers have been received.Http2StreamheadersSent(boolean isInformational)Indicates that headers have been sent to the remote endpoint on this stream.intid()Gets the unique identifier for this stream within the connection.booleanisHeadersReceived()Indicates whether or not the initial headers have been received.booleanisHeadersSent()Indicates whether or not headers were sent to the remote endpoint.booleanisPushPromiseSent()Indicates whether or not a push promise was sent to the remote endpoint.booleanisResetSent()Indicates whether aRST_STREAMframe has been sent from the local endpoint for this stream.booleanisTrailersReceived()Indicates whether or not the trailers have been received.booleanisTrailersSent()Indicates whether or not trailers were sent to the remote endpoint.Http2Streamopen(boolean halfClosed)Opens this stream, making it available viaHttp2Connection.forEachActiveStream(Http2StreamVisitor)and transition state to:Http2Stream.State.OPENifstate()isHttp2Stream.State.IDLEandhalfClosedisfalse.Http2Stream.State.HALF_CLOSED_LOCALifstate()isHttp2Stream.State.IDLEandhalfClosedistrueand the stream is local.Http2StreampushPromiseSent()Indicates that a push promise was sent to the remote endpoint.<V> VremoveProperty(Http2Connection.PropertyKey key)Returns and removes application-defined data if any was associated with this stream.Http2StreamresetSent()Sets the flag indicating that aRST_STREAMframe has been sent from the local endpoint for this stream.<V> VsetProperty(Http2Connection.PropertyKey key, V value)Associates the application-defined data with this stream.Http2Stream.Statestate()Gets the state of this stream.
-
-
-
Method Detail
-
id
int id()
Gets the unique identifier for this stream within the connection.
-
state
Http2Stream.State state()
Gets the state of this stream.
-
open
Http2Stream open(boolean halfClosed) throws Http2Exception
Opens this stream, making it available viaHttp2Connection.forEachActiveStream(Http2StreamVisitor)and transition state to:Http2Stream.State.OPENifstate()isHttp2Stream.State.IDLEandhalfClosedisfalse.Http2Stream.State.HALF_CLOSED_LOCALifstate()isHttp2Stream.State.IDLEandhalfClosedistrueand the stream is local. In this state,isHeadersSent()istrueHttp2Stream.State.HALF_CLOSED_REMOTEifstate()isHttp2Stream.State.IDLEandhalfClosedistrueand the stream is remote. In this state,isHeadersReceived()istrueHttp2Stream.State.RESERVED_LOCALifstate()isHttp2Stream.State.HALF_CLOSED_REMOTE.Http2Stream.State.RESERVED_REMOTEifstate()isHttp2Stream.State.HALF_CLOSED_LOCAL.
- Throws:
Http2Exception
-
close
Http2Stream close()
Closes the stream.
-
closeLocalSide
Http2Stream closeLocalSide()
Closes the local side of this stream. If this makes the stream closed, the child is closed as well.
-
closeRemoteSide
Http2Stream closeRemoteSide()
Closes the remote side of this stream. If this makes the stream closed, the child is closed as well.
-
isResetSent
boolean isResetSent()
Indicates whether aRST_STREAMframe has been sent from the local endpoint for this stream.
-
resetSent
Http2Stream resetSent()
Sets the flag indicating that aRST_STREAMframe has been sent from the local endpoint for this stream. This does not affect the stream state.
-
setProperty
<V> V setProperty(Http2Connection.PropertyKey key, V value)
Associates the application-defined data with this stream.- Returns:
- The value that was previously associated with
key, ornullif there was none.
-
getProperty
<V> V getProperty(Http2Connection.PropertyKey key)
Returns application-defined data if any was associated with this stream.
-
removeProperty
<V> V removeProperty(Http2Connection.PropertyKey key)
Returns and removes application-defined data if any was associated with this stream.
-
headersSent
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 (seeisHeadersSent()} and the second call would indicate the trailers (seeisTrailersReceived()).- Parameters:
isInformational-trueif the headers contain an informational status code (for responses only).
-
isHeadersSent
boolean isHeadersSent()
Indicates whether or not headers were sent to the remote endpoint.
-
isTrailersSent
boolean isTrailersSent()
Indicates whether or not trailers were sent to the remote endpoint.
-
headersReceived
Http2Stream headersReceived(boolean isInformational)
Indicates that headers have been received. The first call to this method would be for the initial headers (seeisHeadersReceived()} and the second call would indicate the trailers (seeisTrailersReceived()).- Parameters:
isInformational-trueif the headers contain an informational status code (for responses only).
-
isHeadersReceived
boolean isHeadersReceived()
Indicates whether or not the initial headers have been received.
-
isTrailersReceived
boolean isTrailersReceived()
Indicates whether or not the trailers have been received.
-
pushPromiseSent
Http2Stream pushPromiseSent()
Indicates that a push promise was sent to the remote endpoint.
-
isPushPromiseSent
boolean isPushPromiseSent()
Indicates whether or not a push promise was sent to the remote endpoint.
-
-