private class DefaultHttp2Connection.DefaultStream extends java.lang.Object implements Http2Stream
Modifier and Type | Class and Description |
---|---|
private class |
DefaultHttp2Connection.DefaultStream.PropertyMap
Provides the lazy initialization for the
DefaultHttp2Connection.DefaultStream data map. |
Http2Stream.State
Modifier and Type | Field and Description |
---|---|
private int |
id |
private DefaultHttp2Connection.DefaultStream.PropertyMap |
properties |
private static byte |
SENT_STATE_HEADERS |
private static byte |
SENT_STATE_PUSHPROMISE |
private static byte |
SENT_STATE_RST |
private byte |
sentState |
private Http2Stream.State |
state |
Constructor and Description |
---|
DefaultStream(int id,
Http2Stream.State state) |
Modifier and Type | Method and Description |
---|---|
(package private) void |
activate() |
Http2Stream |
close()
Closes the stream.
|
(package private) Http2Stream |
close(java.util.Iterator<?> itr) |
Http2Stream |
closeLocalSide()
Closes the local side of this stream.
|
Http2Stream |
closeRemoteSide()
Closes the remote side of this stream.
|
(package private) DefaultHttp2Connection.DefaultEndpoint<? extends Http2FlowController> |
createdBy() |
<V> V |
getProperty(Http2Connection.PropertyKey key)
Returns application-defined data if any was associated with this stream.
|
Http2Stream |
headersSent()
Indicates that headers has been sent to the remote on this stream.
|
int |
id()
Gets the unique identifier for this stream within the connection.
|
boolean |
isHeadersSent()
Indicates whether or not headers was sent to the remote endpoint.
|
(package private) boolean |
isLocal() |
boolean |
isPushPromiseSent()
Indicates whether or not a push promise was sent to the remote endpoint.
|
boolean |
isResetSent()
Indicates whether a
RST_STREAM frame has been sent from the local endpoint for this stream. |
Http2Stream |
open(boolean halfClosed)
Opens this stream, making it available via
Http2Connection.forEachActiveStream(Http2StreamVisitor) and
transition state to:
Http2Stream.State.OPEN if Http2Stream.state() is Http2Stream.State.IDLE and halfClosed is false .
Http2Stream.State.HALF_CLOSED_LOCAL if Http2Stream.state() is Http2Stream.State.IDLE and halfClosed
is true and the stream is local.
Http2Stream.State.HALF_CLOSED_REMOTE if Http2Stream.state() is Http2Stream.State.IDLE and halfClosed
is true and the stream is remote.
Http2Stream.State.RESERVED_LOCAL if Http2Stream.state() is Http2Stream.State.HALF_CLOSED_REMOTE .
Http2Stream.State.RESERVED_REMOTE if Http2Stream.state() is Http2Stream.State.HALF_CLOSED_LOCAL .
|
Http2Stream |
pushPromiseSent()
Indicates that a push promise was sent to the remote endpoint.
|
<V> V |
removeProperty(Http2Connection.PropertyKey key)
Returns and removes application-defined data if any was associated with this stream.
|
Http2Stream |
resetSent()
Sets the flag indicating that a
RST_STREAM frame has been sent from the local endpoint
for this stream. |
<V> V |
setProperty(Http2Connection.PropertyKey key,
V value)
Associates the application-defined data with this stream.
|
Http2Stream.State |
state()
Gets the state of this stream.
|
private static final byte SENT_STATE_RST
private static final byte SENT_STATE_HEADERS
private static final byte SENT_STATE_PUSHPROMISE
private final int id
private final DefaultHttp2Connection.DefaultStream.PropertyMap properties
private Http2Stream.State state
private byte sentState
DefaultStream(int id, Http2Stream.State state)
public final int id()
Http2Stream
id
in interface Http2Stream
public final Http2Stream.State state()
Http2Stream
state
in interface Http2Stream
public boolean isResetSent()
Http2Stream
RST_STREAM
frame has been sent from the local endpoint for this stream.isResetSent
in interface Http2Stream
public Http2Stream resetSent()
Http2Stream
RST_STREAM
frame has been sent from the local endpoint
for this stream. This does not affect the stream state.resetSent
in interface Http2Stream
public Http2Stream headersSent()
Http2Stream
headersSent
in interface Http2Stream
public boolean isHeadersSent()
Http2Stream
isHeadersSent
in interface Http2Stream
public Http2Stream pushPromiseSent()
Http2Stream
pushPromiseSent
in interface Http2Stream
public boolean isPushPromiseSent()
Http2Stream
isPushPromiseSent
in interface Http2Stream
public final <V> V setProperty(Http2Connection.PropertyKey key, V value)
Http2Stream
setProperty
in interface Http2Stream
key
, or null
if there was none.public final <V> V getProperty(Http2Connection.PropertyKey key)
Http2Stream
getProperty
in interface Http2Stream
public final <V> V removeProperty(Http2Connection.PropertyKey key)
Http2Stream
removeProperty
in interface Http2Stream
public Http2Stream open(boolean halfClosed) throws Http2Exception
Http2Stream
Http2Connection.forEachActiveStream(Http2StreamVisitor)
and
transition state to:
Http2Stream.State.OPEN
if Http2Stream.state()
is Http2Stream.State.IDLE
and halfClosed
is false
.Http2Stream.State.HALF_CLOSED_LOCAL
if Http2Stream.state()
is Http2Stream.State.IDLE
and halfClosed
is true
and the stream is local.Http2Stream.State.HALF_CLOSED_REMOTE
if Http2Stream.state()
is Http2Stream.State.IDLE
and halfClosed
is true
and the stream is remote.Http2Stream.State.RESERVED_LOCAL
if Http2Stream.state()
is Http2Stream.State.HALF_CLOSED_REMOTE
.Http2Stream.State.RESERVED_REMOTE
if Http2Stream.state()
is Http2Stream.State.HALF_CLOSED_LOCAL
.open
in interface Http2Stream
Http2Exception
void activate()
Http2Stream close(java.util.Iterator<?> itr)
public Http2Stream close()
Http2Stream
close
in interface Http2Stream
public Http2Stream closeLocalSide()
Http2Stream
closeLocalSide
in interface Http2Stream
public Http2Stream closeRemoteSide()
Http2Stream
closeRemoteSide
in interface Http2Stream
DefaultHttp2Connection.DefaultEndpoint<? extends Http2FlowController> createdBy()
final boolean isLocal()