Package org.eclipse.jetty.http2.server
Class HTTP2ServerConnection
- java.lang.Object
-
- org.eclipse.jetty.io.AbstractConnection
-
- org.eclipse.jetty.http2.HTTP2Connection
-
- org.eclipse.jetty.http2.server.HTTP2ServerConnection
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Connection
,Connection.UpgradeTo
,WriteFlusher.Listener
public class HTTP2ServerConnection extends HTTP2Connection implements Connection.UpgradeTo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
HTTP2ServerConnection.ServerHttpChannelOverHTTP2
-
Nested classes/interfaces inherited from class org.eclipse.jetty.http2.HTTP2Connection
HTTP2Connection.HTTP2Producer
-
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
-
-
Field Summary
-
Fields inherited from class org.eclipse.jetty.http2.HTTP2Connection
LOG
-
-
Constructor Summary
Constructors Constructor Description HTTP2ServerConnection(ByteBufferPool byteBufferPool, java.util.concurrent.Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, ISession session, int inputBufferSize, ServerSessionListener listener)
HTTP2ServerConnection(ByteBufferPool byteBufferPool, java.util.concurrent.Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, ServerParser parser, ISession session, int inputBufferSize, ServerSessionListener listener)
Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ServerParser
getParser()
boolean
isRecycleHttpChannels()
static boolean
isSupportedProtocol(java.lang.String protocol)
protected HTTP2ServerConnection.ServerHttpChannelOverHTTP2
newServerHttpChannelOverHTTP2(Connector connector, HttpConfiguration httpConfig, HttpTransportOverHTTP2 transport)
void
onData(IStream stream, DataFrame frame, Callback callback)
void
onNewStream(Connector connector, IStream stream, HeadersFrame frame)
void
onOpen()
Callback method invoked when this connection is opened.void
onSessionFailure(java.lang.Throwable failure, Callback callback)
boolean
onSessionTimeout(java.lang.Throwable failure)
void
onStreamFailure(IStream stream, java.lang.Throwable failure, Callback callback)
boolean
onStreamTimeout(IStream stream, java.lang.Throwable failure)
void
onTrailers(IStream stream, HeadersFrame frame)
void
onUpgradeTo(java.nio.ByteBuffer buffer)
Invoked during anupgrade
to receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.void
push(Connector connector, IStream stream, MetaData.Request request)
void
setRecycleHttpChannels(boolean recycleHttpChannels)
boolean
upgrade(MetaData.Request request)
-
Methods inherited from class org.eclipse.jetty.http2.HTTP2Connection
close, dispatch, getBytesIn, getBytesOut, getMessagesIn, getMessagesOut, getSession, offerTask, onClose, onFillable, onFlushed, onIdleExpired, produce, setInputBuffer, wrapParserListener
-
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addListener, failedCallback, fillInterested, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, isFillInterested, onFillInterestedFailed, onReadTimeout, removeListener, setInputBufferSize, toConnectionString, toString, tryFillInterested, tryFillInterested
-
-
-
-
Constructor Detail
-
HTTP2ServerConnection
@Deprecated public HTTP2ServerConnection(ByteBufferPool byteBufferPool, java.util.concurrent.Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, ServerParser parser, ISession session, int inputBufferSize, ServerSessionListener listener)
Deprecated.
-
HTTP2ServerConnection
public HTTP2ServerConnection(ByteBufferPool byteBufferPool, java.util.concurrent.Executor executor, EndPoint endPoint, HttpConfiguration httpConfig, ISession session, int inputBufferSize, ServerSessionListener listener)
-
-
Method Detail
-
isSupportedProtocol
public static boolean isSupportedProtocol(java.lang.String protocol)
- Parameters:
protocol
- An HTTP2 protocol variant- Returns:
- True if the protocol version is supported
-
getParser
protected ServerParser getParser()
- Overrides:
getParser
in classHTTP2Connection
-
isRecycleHttpChannels
public boolean isRecycleHttpChannels()
-
setRecycleHttpChannels
public void setRecycleHttpChannels(boolean recycleHttpChannels)
-
onUpgradeTo
public void onUpgradeTo(java.nio.ByteBuffer buffer)
Description copied from interface:Connection.UpgradeTo
Invoked during an
upgrade
to receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.- Specified by:
onUpgradeTo
in interfaceConnection.UpgradeTo
- Parameters:
buffer
- a non-null buffer of unconsumed bytes received from the upgrade-from connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes.
-
onOpen
public void onOpen()
Description copied from interface:Connection
Callback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpen
in interfaceConnection
- Overrides:
onOpen
in classHTTP2Connection
-
onNewStream
public void onNewStream(Connector connector, IStream stream, HeadersFrame frame)
-
onTrailers
public void onTrailers(IStream stream, HeadersFrame frame)
-
onStreamTimeout
public boolean onStreamTimeout(IStream stream, java.lang.Throwable failure)
-
onStreamFailure
public void onStreamFailure(IStream stream, java.lang.Throwable failure, Callback callback)
-
onSessionTimeout
public boolean onSessionTimeout(java.lang.Throwable failure)
-
onSessionFailure
public void onSessionFailure(java.lang.Throwable failure, Callback callback)
-
push
public void push(Connector connector, IStream stream, MetaData.Request request)
-
newServerHttpChannelOverHTTP2
protected HTTP2ServerConnection.ServerHttpChannelOverHTTP2 newServerHttpChannelOverHTTP2(Connector connector, HttpConfiguration httpConfig, HttpTransportOverHTTP2 transport)
-
upgrade
public boolean upgrade(MetaData.Request request)
-
-