public class DefaultHttp2Connection extends Object implements Http2Connection
Http2Connection.Http2Connection.Endpoint<F extends Http2FlowController>, Http2Connection.Listener| Constructor and Description |
|---|
DefaultHttp2Connection(boolean server)
Creates a connection with an immediate stream removal policy.
|
DefaultHttp2Connection(boolean server,
Http2StreamRemovalPolicy removalPolicy)
Creates a new connection with the given settings.
|
| Modifier and Type | Method and Description |
|---|---|
Set<Http2Stream> |
activeStreams()
Gets all streams that are actively in use.
|
void |
addListener(Http2Connection.Listener listener)
Adds a listener of stream life-cycle events.
|
Http2Stream |
connectionStream()
Gets the stream object representing the connection, itself (i.e. stream zero).
|
Http2Stream |
createLocalStream(int streamId)
Creates a new stream initiated by the local endpoint
|
Http2Stream |
createRemoteStream(int streamId)
Creates a new stream initiated by the remote endpoint.
|
void |
deactivate(Http2Stream stream)
Indicates that the given stream is no longer actively in use.
|
boolean |
goAwayReceived()
Indicates whether or not a
GOAWAY was received from the remote endpoint. |
void |
goAwayReceived(int lastKnownStream)
Indicates that a
GOAWAY was received from the remote endpoint and sets the last known stream. |
boolean |
goAwaySent()
Indicates whether or not a
GOAWAY was sent to the remote endpoint. |
void |
goAwaySent(int lastKnownStream)
Indicates that a
GOAWAY was sent to the remote endpoint and sets the last known stream. |
boolean |
isGoAway()
Indicates whether or not either endpoint has received a GOAWAY.
|
boolean |
isServer()
Indicates whether or not the local endpoint for this connection is the server.
|
Http2Connection.Endpoint<Http2LocalFlowController> |
local()
Gets a view of this connection from the local
Http2Connection.Endpoint. |
int |
numActiveStreams()
Gets the number of streams that actively in use.
|
Http2Connection.Endpoint<Http2RemoteFlowController> |
remote()
Gets a view of this connection from the remote
Http2Connection.Endpoint. |
void |
removeListener(Http2Connection.Listener listener)
Removes a listener of stream life-cycle events.
|
Http2Stream |
requireStream(int streamId)
Attempts to get the stream for the given ID.
|
Http2Stream |
stream(int streamId)
Gets the stream if it exists.
|
public DefaultHttp2Connection(boolean server)
server - whether or not this end-point is the server-side of the HTTP/2 connection.public DefaultHttp2Connection(boolean server,
Http2StreamRemovalPolicy removalPolicy)
server - whether or not this end-point is the server-side of the HTTP/2 connection.removalPolicy - the policy to be used for removal of closed stream.public void addListener(Http2Connection.Listener listener)
Http2ConnectionaddListener in interface Http2Connectionpublic void removeListener(Http2Connection.Listener listener)
Http2ConnectionremoveListener in interface Http2Connectionpublic boolean isServer()
Http2ConnectionisServer in interface Http2Connectionpublic Http2Stream connectionStream()
Http2ConnectionconnectionStream in interface Http2Connectionpublic Http2Stream requireStream(int streamId) throws Http2Exception
Http2ConnectionrequireStream in interface Http2ConnectionHttp2Exceptionpublic Http2Stream stream(int streamId)
Http2Connectionnull.stream in interface Http2Connectionpublic int numActiveStreams()
Http2ConnectionnumActiveStreams in interface Http2Connectionpublic Set<Http2Stream> activeStreams()
Http2ConnectionactiveStreams in interface Http2Connectionpublic void deactivate(Http2Stream stream)
Http2ConnectionHttp2Connection.activeStreams() and Http2Connection.numActiveStreams() will be decremented. In addition,
all listeners will be notified of this event via
Http2Connection.Listener.streamInactive(Http2Stream).deactivate in interface Http2Connectionpublic Http2Connection.Endpoint<Http2LocalFlowController> local()
Http2ConnectionHttp2Connection.Endpoint.local in interface Http2Connectionpublic Http2Connection.Endpoint<Http2RemoteFlowController> remote()
Http2ConnectionHttp2Connection.Endpoint.remote in interface Http2Connectionpublic boolean isGoAway()
Http2ConnectionisGoAway in interface Http2Connectionpublic Http2Stream createLocalStream(int streamId) throws Http2Exception
Http2ConnectioncreateLocalStream in interface Http2ConnectionHttp2ExceptionHttp2Connection.Endpoint.createStream(int)public Http2Stream createRemoteStream(int streamId) throws Http2Exception
Http2ConnectioncreateRemoteStream in interface Http2ConnectionHttp2ExceptionHttp2Connection.Endpoint.createStream(int)public boolean goAwayReceived()
Http2ConnectionGOAWAY was received from the remote endpoint.goAwayReceived in interface Http2Connectionpublic void goAwayReceived(int lastKnownStream)
Http2ConnectionGOAWAY was received from the remote endpoint and sets the last known stream.goAwayReceived in interface Http2Connectionpublic boolean goAwaySent()
Http2ConnectionGOAWAY was sent to the remote endpoint.goAwaySent in interface Http2Connectionpublic void goAwaySent(int lastKnownStream)
Http2ConnectionGOAWAY was sent to the remote endpoint and sets the last known stream.goAwaySent in interface Http2ConnectionCopyright © 2008–2015 The Netty Project. All rights reserved.