Class HTTP2ServerConnection
java.lang.Object
org.eclipse.jetty.io.AbstractConnection
org.eclipse.jetty.http2.HTTP2Connection
org.eclipse.jetty.http2.server.internal.HTTP2ServerConnection
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Parser.Listener
,ServerParser.Listener
,Connection
,Connection.UpgradeTo
,ConnectionMetaData
,Attributes
,Invocable
public class HTTP2ServerConnection
extends HTTP2Connection
implements ConnectionMetaData, ServerParser.Listener
-
Nested Class Summary
Nested classes/interfaces inherited from class org.eclipse.jetty.http2.HTTP2Connection
HTTP2Connection.HTTP2Producer
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.Layer, Attributes.Lazy, Attributes.Mapped, Attributes.Synthetic
Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection
Connection.Listener, Connection.UpgradeFrom, Connection.UpgradeTo
Nested classes/interfaces inherited from interface org.eclipse.jetty.server.ConnectionMetaData
ConnectionMetaData.Wrapper
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable
Invocable.Callable, Invocable.InvocationType, Invocable.ReadyTask, Invocable.Task
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.parser.Parser.Listener
Parser.Listener.Wrapper
Nested classes/interfaces inherited from interface org.eclipse.jetty.http2.parser.ServerParser.Listener
ServerParser.Listener.Wrapper
-
Field Summary
Fields inherited from interface org.eclipse.jetty.util.Attributes
NULL
Fields inherited from interface org.eclipse.jetty.util.thread.Invocable
__nonBlocking, NOOP
-
Constructor Summary
ConstructorDescriptionHTTP2ServerConnection
(Connector connector, EndPoint endPoint, HttpConfiguration httpConfig, HTTP2ServerSession session, int inputBufferSize, ServerSessionListener listener) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Clear all attribute namesgetAttribute
(String name) Get an attributeGet the immutable set of attribute names.getId()
boolean
boolean
boolean
void
onDataAvailable
(Stream stream) void
onNewStream
(HTTP2Stream stream, HeadersFrame frame) void
onOpen()
Callback method invoked when this connection is opened.void
void
onSessionFailure
(Throwable failure, Callback callback) boolean
onSessionTimeout
(Throwable failure) void
onStreamFailure
(Stream stream, Throwable failure, Callback callback) void
onStreamTimeout
(Stream stream, TimeoutException timeout, Promise<Boolean> promise) void
onTrailers
(Stream stream, HeadersFrame frame) void
push
(HTTP2Stream stream, MetaData.Request request) removeAttribute
(String name) Remove an attributesetAttribute
(String name, Object attribute) Set an attributevoid
setRecycleHttpChannels
(boolean recycleHttpChannels) boolean
upgrade
(MetaData.Request request, HttpFields.Mutable responseFields) Methods inherited from class org.eclipse.jetty.http2.HTTP2Connection
close, dispatch, getBytesIn, getBytesOut, getMessagesIn, getMessagesOut, isUseInputDirectByteBuffers, isUseOutputDirectByteBuffers, offerTask, onClose, onConnectionFailure, onData, onFillable, onGoAway, onHeaders, onIdleExpired, onPing, onPriority, onPushPromise, onReset, onSettings, onStreamFailure, onUpgradeTo, onWindowUpdate, produce, setUseInputDirectByteBuffers, setUseOutputDirectByteBuffers
Methods inherited from class org.eclipse.jetty.io.AbstractConnection
addEventListener, failedCallback, fillInterested, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, getInvocationType, isFillInterested, onFillInterestedFailed, onReadTimeout, removeEventListener, setInputBufferSize, toConnectionString, toString, tryFillInterested
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.eclipse.jetty.util.Attributes
asAttributeMap, equals, hashCode
Methods inherited from interface org.eclipse.jetty.server.ConnectionMetaData
getServerAuthority, isSecure
Methods inherited from interface org.eclipse.jetty.http2.parser.Parser.Listener
onConnectionFailure, onData, onGoAway, onHeaders, onPing, onPriority, onPushPromise, onReset, onSettings, onStreamFailure, onWindowUpdate
-
Constructor Details
-
HTTP2ServerConnection
public HTTP2ServerConnection(Connector connector, EndPoint endPoint, HttpConfiguration httpConfig, HTTP2ServerSession session, int inputBufferSize, ServerSessionListener listener)
-
-
Method Details
-
isRecycleHttpChannels
public boolean isRecycleHttpChannels() -
setRecycleHttpChannels
public void setRecycleHttpChannels(boolean recycleHttpChannels) -
getSession
- Overrides:
getSession
in classHTTP2Connection
-
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
-
onPreface
public void onPreface()- Specified by:
onPreface
in interfaceServerParser.Listener
-
onNewStream
-
onDataAvailable
-
onTrailers
-
onStreamTimeout
-
onStreamFailure
-
onSessionTimeout
-
onSessionFailure
-
push
-
upgrade
-
getId
- Specified by:
getId
in interfaceConnectionMetaData
- Returns:
- a unique (within the lifetime of the JVM) identifier string for the network connection to the JVM
-
getHttpConfiguration
- Specified by:
getHttpConfiguration
in interfaceConnectionMetaData
-
getHttpVersion
- Specified by:
getHttpVersion
in interfaceConnectionMetaData
-
getProtocol
- Specified by:
getProtocol
in interfaceConnectionMetaData
-
getConnection
- Specified by:
getConnection
in interfaceConnectionMetaData
-
getConnector
- Specified by:
getConnector
in interfaceConnectionMetaData
-
isPersistent
public boolean isPersistent()- Specified by:
isPersistent
in interfaceConnectionMetaData
-
isPushSupported
public boolean isPushSupported()- Specified by:
isPushSupported
in interfaceConnectionMetaData
- Returns:
- whether the functionality of pushing resources is supported
-
getRemoteSocketAddress
- Specified by:
getRemoteSocketAddress
in interfaceConnectionMetaData
- Returns:
- The address of the remote end of this connection. By default, this is the first hop of the underlying network connection, but it may be wrapped to represent a more remote end point.
-
getLocalSocketAddress
- Specified by:
getLocalSocketAddress
in interfaceConnectionMetaData
- Returns:
- The address of the local end of this connection. By default, this is the address of the underlying network connection, but it may be wrapped if the deployment wishes to hide all local details.
-
getAttribute
Description copied from interface:Attributes
Get an attribute- Specified by:
getAttribute
in interfaceAttributes
- Parameters:
name
- the attribute to get- Returns:
- the value of the attribute, or
null
if no such attribute exists
-
setAttribute
Description copied from interface:Attributes
Set an attribute- Specified by:
setAttribute
in interfaceAttributes
- Parameters:
name
- the attribute to setattribute
- the value to set. A null value is equivalent to removing the attribute.- Returns:
- the previous value of the attribute if set, else
null
-
removeAttribute
Description copied from interface:Attributes
Remove an attribute- Specified by:
removeAttribute
in interfaceAttributes
- Parameters:
name
- the attribute to remove- Returns:
- the value of the attribute if removed, else
null
-
getAttributeNameSet
Description copied from interface:Attributes
Get the immutable set of attribute names.- Specified by:
getAttributeNameSet
in interfaceAttributes
- Returns:
- Set of attribute names, or an empty set if there are no attributes.
-
clearAttributes
public void clearAttributes()Description copied from interface:Attributes
Clear all attribute names- Specified by:
clearAttributes
in interfaceAttributes
-