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 classHTTP2ServerConnection.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 ServerParsergetParser()booleanisRecycleHttpChannels()static booleanisSupportedProtocol(java.lang.String protocol)protected HTTP2ServerConnection.ServerHttpChannelOverHTTP2newServerHttpChannelOverHTTP2(Connector connector, HttpConfiguration httpConfig, HttpTransportOverHTTP2 transport)voidonData(IStream stream, DataFrame frame, Callback callback)voidonNewStream(Connector connector, IStream stream, HeadersFrame frame)voidonOpen()Callback method invoked when this connection is opened.voidonSessionFailure(java.lang.Throwable failure, Callback callback)booleanonSessionTimeout(java.lang.Throwable failure)voidonStreamFailure(IStream stream, java.lang.Throwable failure, Callback callback)booleanonStreamTimeout(IStream stream, java.lang.Throwable failure)voidonTrailers(IStream stream, HeadersFrame frame)voidonUpgradeTo(java.nio.ByteBuffer buffer)Invoked during anupgradeto receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.voidpush(Connector connector, IStream stream, MetaData.Request request)voidsetRecycleHttpChannels(boolean recycleHttpChannels)booleanupgrade(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:
getParserin classHTTP2Connection
-
isRecycleHttpChannels
public boolean isRecycleHttpChannels()
-
setRecycleHttpChannels
public void setRecycleHttpChannels(boolean recycleHttpChannels)
-
onUpgradeTo
public void onUpgradeTo(java.nio.ByteBuffer buffer)
Description copied from interface:Connection.UpgradeToInvoked during an
upgradeto 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:
onUpgradeToin 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:ConnectionCallback method invoked when this connection is opened.
Creators of the connection implementation are responsible for calling this method.
- Specified by:
onOpenin interfaceConnection- Overrides:
onOpenin 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)
-
-