public interface Http2Stream
Modifier and Type | Interface and Description |
---|---|
static class |
Http2Stream.State
The allowed states of an HTTP2 stream.
|
Modifier and Type | Method and Description |
---|---|
Http2Stream |
child(int streamId)
Attempts to find a child of this stream with the given ID.
|
Collection<? extends Http2Stream> |
children()
Gets all streams that are direct dependents on this stream.
|
Http2Stream |
close()
Closes the stream.
|
Http2Stream |
closeLocalSide()
Closes the local side of this stream.
|
Http2Stream |
closeRemoteSide()
Closes the remote side of this stream.
|
<V> V |
getProperty(Object key)
Returns application-defined data if any was associated with this stream.
|
boolean |
hasChild(int streamId)
Indicates whether the given stream is a direct child of this stream.
|
int |
id()
Gets the unique identifier for this stream within the connection.
|
boolean |
isDescendantOf(Http2Stream stream)
Indicates whether or not this stream is a descendant in the priority tree from the given stream.
|
boolean |
isLeaf()
Indicates whether or not this is a leaf node (i.e.
|
boolean |
isResetSent()
Indicates whether a
RST_STREAM frame has been sent from the local endpoint for this stream. |
boolean |
isRoot()
Indicates whether or not this stream is the root node of the priority tree.
|
boolean |
localSideOpen()
Indicates whether the local side of this stream is open (i.e. the state is either
Http2Stream.State.OPEN or Http2Stream.State.HALF_CLOSED_REMOTE ). |
int |
numChildren()
Returns the number of child streams directly dependent on this stream.
|
Http2Stream |
open(boolean halfClosed)
Add this stream to
Http2Connection.activeStreams() and transition state to:
Http2Stream.State.OPEN if state() is Http2Stream.State.IDLE and halfClosed is false . |
Http2Stream |
parent()
The parent (i.e. the node in the priority tree on which this node depends), or
null
if this is the root node (i.e. the connection, itself). |
boolean |
remoteSideOpen()
Indicates whether the remote side of this stream is open (i.e. the state is either
Http2Stream.State.OPEN or Http2Stream.State.HALF_CLOSED_LOCAL ). |
<V> V |
removeProperty(Object 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. |
Http2Stream |
setPriority(int parentStreamId,
short weight,
boolean exclusive)
Updates an priority for this stream.
|
Object |
setProperty(Object key,
Object value)
Associates the application-defined data with this stream.
|
Http2Stream.State |
state()
Gets the state of this stream.
|
int |
totalChildWeights()
The total of the weights of all children of this stream.
|
short |
weight()
Returns weight assigned to the dependency with the parent.
|
int id()
Http2Stream.State state()
Http2Stream open(boolean halfClosed) throws Http2Exception
Http2Connection.activeStreams()
and transition state to:
Http2Stream.State.OPEN
if state()
is Http2Stream.State.IDLE
and halfClosed
is false
.Http2Stream.State.HALF_CLOSED_LOCAL
if state()
is Http2Stream.State.IDLE
and halfClosed
is true
and the stream is local.Http2Stream.State.HALF_CLOSED_REMOTE
if state()
is Http2Stream.State.IDLE
and halfClosed
is true
and the stream is remote.Http2Stream.State.RESERVED_LOCAL
if state()
is Http2Stream.State.HALF_CLOSED_REMOTE
.Http2Stream.State.RESERVED_REMOTE
if state()
is Http2Stream.State.HALF_CLOSED_LOCAL
.Http2Exception
Http2Stream close()
Http2Stream closeLocalSide()
Http2Stream closeRemoteSide()
boolean isResetSent()
RST_STREAM
frame has been sent from the local endpoint for this stream.Http2Stream resetSent()
RST_STREAM
frame has been sent from the local endpoint
for this stream. This does not affect the stream state.boolean remoteSideOpen()
Http2Stream.State.OPEN
or Http2Stream.State.HALF_CLOSED_LOCAL
).boolean localSideOpen()
Http2Stream.State.OPEN
or Http2Stream.State.HALF_CLOSED_REMOTE
).Object setProperty(Object key, Object value)
key
, or null
if there was none.<V> V getProperty(Object key)
<V> V removeProperty(Object key)
Http2Stream setPriority(int parentStreamId, short weight, boolean exclusive) throws Http2Exception
parentStreamId
- the parent stream that given stream should depend on. May be 0
,
if the stream has no dependencies and should be an immediate child of the
connection.weight
- the weight to be assigned to this stream relative to its parent. This value
must be between 1 and 256 (inclusive)exclusive
- indicates that the stream should be the exclusive dependent on its parent.
This only applies if the stream has a parent.Http2Exception
boolean isRoot()
boolean isLeaf()
numChildren()
is 0) of the priority tree.short weight()
int totalChildWeights()
Http2Stream parent()
null
if this is the root node (i.e. the connection, itself).boolean isDescendantOf(Http2Stream stream)
int numChildren()
boolean hasChild(int streamId)
Http2Stream child(int streamId)
null
.Collection<? extends Http2Stream> children()
Copyright © 2008–2015 The Netty Project. All rights reserved.