- All Implemented Interfaces:
Session,Parser.Listener,org.eclipse.jetty.util.component.Container,org.eclipse.jetty.util.component.Destroyable,org.eclipse.jetty.util.component.Dumpable,org.eclipse.jetty.util.component.Dumpable.DumpableContainer,org.eclipse.jetty.util.component.LifeCycle
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopExceptionNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container
org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
org.eclipse.jetty.util.component.Dumpable.DumpableContainerNested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle
org.eclipse.jetty.util.component.LifeCycle.ListenerNested classes/interfaces inherited from interface org.eclipse.jetty.http2.parser.Parser.Listener
Parser.Listener.WrapperNested classes/interfaces inherited from interface org.eclipse.jetty.http2.api.Session
Session.Listener -
Field Summary
Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
FAILED, STARTED, STARTING, STOPPED, STOPPINGFields inherited from interface org.eclipse.jetty.util.component.Dumpable
KEY -
Constructor Summary
ConstructorsConstructorDescriptionHTTP2Session(org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.EndPoint endPoint, Parser parser, Generator generator, Session.Listener listener, FlowControlStrategy flowControl, int initialStreamId) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanInvoked internally and by applications to send a GO_AWAY frame to the other peer.protected HTTP2StreamcreateLocalStream(int streamId, org.eclipse.jetty.http.MetaData.Request request, Consumer<Throwable> failFn) protected HTTP2StreamcreateRemoteStream(int streamId, org.eclipse.jetty.http.MetaData.Request request) voiddata(HTTP2Stream stream, DataFrame frame, org.eclipse.jetty.util.Callback callback) voidprotected voiddoStop()voiddump(Appendable out, String indent) voidframes(HTTP2Stream stream, List<? extends Frame> frames, org.eclipse.jetty.util.Callback callback) longorg.eclipse.jetty.io.EndPointintprotected intintintintintintintgetStream(int streamId) Retrieves the stream with the givenstreamId.intlonglonglongintbooleangoAway(GoAwayFrame frame, org.eclipse.jetty.util.Callback callback) protected static booleanisClientStream(int streamId) booleanisClosed()booleanbooleanprotected booleanisLocalStreamClosed(int streamId) booleanprotected booleanisRemoteStreamClosed(int streamId) protected HTTP2StreamnewStream(int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local) voidnewStream(HeadersFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) Sends the given HEADERSframeto create a newStream.voidnewStream(HTTP2Stream.FrameList frames, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) newUpgradeStream(HeadersFrame frame, Stream.Listener listener, Consumer<Throwable> failFn) Creates a new stream allocating a stream id if the given HEADERS frame does not have one.protected voidnotifyClose(Session session, GoAwayFrame frame, org.eclipse.jetty.util.Callback callback) protected voidnotifyFailure(Session session, Throwable failure, org.eclipse.jetty.util.Callback callback) protected voidnotifyGoAway(Session session, GoAwayFrame frame) protected booleannotifyIdleTimeout(Session session) protected Stream.ListenernotifyNewStream(Stream stream, HeadersFrame frame) protected voidnotifyPing(Session session, PingFrame frame) protected voidnotifyReset(Session session, ResetFrame frame) protected voidnotifySettings(Session session, SettingsFrame frame) voidonConnectionFailure(int error, String reason) voidonData(Stream.Data data) voidvoidvoidonGoAway(GoAwayFrame frame) This method is called when receiving a GO_AWAY from the other peer.abstract voidonHeaders(HeadersFrame frame) booleanThis method is invoked when the idle timeout expires.voidvoidonPriority(PriorityFrame frame) voidonReset(ResetFrame frame) protected voidvoidonSettings(SettingsFrame frame) voidonSettings(SettingsFrame frame, boolean reply) voidThis method is called when the TCP FIN is received from the remote peer.voidonStreamFailure(int streamId, int error, String reason) protected final voidonStreamOpened(Stream stream) voidonWindowUpdate(WindowUpdateFrame frame) voidonWindowUpdate(HTTP2Stream stream, WindowUpdateFrame frame) voidonWriteFailure(Throwable failure) voidSends the given PINGframe.intpriority(PriorityFrame frame, org.eclipse.jetty.util.Callback callback) Sends the given PRIORITYframe.voidpush(Stream stream, org.eclipse.jetty.util.Promise<Stream> promise, PushPromiseFrame frame, Stream.Listener listener) booleanremoveStream(Stream stream) voidsetConnectProtocolEnabled(boolean connectProtocolEnabled) voidsetInitialSessionRecvWindow(int initialSessionRecvWindow) voidsetMaxEncoderTableCapacity(int maxEncoderTableCapacity) voidsetMaxLocalStreams(int maxLocalStreams) voidsetMaxRemoteStreams(int maxRemoteStreams) voidsetMaxTotalLocalStreams(int maxTotalLocalStreams) voidsetStreamIdleTimeout(long streamIdleTimeout) voidsettings(SettingsFrame frame, org.eclipse.jetty.util.Callback callback) Sends the given SETTINGSframeto configure the session.voidsetWriteThreshold(int writeThreshold) shutdown()Gracefully closes the session, returning aCompletableFuturethat is completed when all the streams currently being processed are completed.toString()protected voidupdateLastRemoteStreamId(int streamId) intupdateRecvWindow(int delta) intupdateSendWindow(int delta) Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle
addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, installBean, installBean, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeansMethods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle
getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.jetty.util.component.Container
getCachedBeans, getEventListenersMethods inherited from interface org.eclipse.jetty.util.component.Dumpable
dumpSelfMethods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer
isDumpableMethods inherited from interface org.eclipse.jetty.http2.parser.Parser.Listener
onPushPromise
-
Constructor Details
-
HTTP2Session
public HTTP2Session(org.eclipse.jetty.util.thread.Scheduler scheduler, org.eclipse.jetty.io.EndPoint endPoint, Parser parser, Generator generator, Session.Listener listener, FlowControlStrategy flowControl, int initialStreamId)
-
-
Method Details
-
doStop
-
getFlowControlStrategy
@ManagedAttribute(value="The flow control strategy", readonly=true) public FlowControlStrategy getFlowControlStrategy() -
getStreamsOpened
@ManagedAttribute(value="The total number of streams opened", readonly=true) public long getStreamsOpened() -
getStreamsClosed
@ManagedAttribute(value="The total number of streams closed", readonly=true) public long getStreamsClosed() -
getMaxLocalStreams
@ManagedAttribute("The maximum number of concurrent local streams") public int getMaxLocalStreams() -
setMaxLocalStreams
public void setMaxLocalStreams(int maxLocalStreams) -
getMaxTotalLocalStreams
@ManagedAttribute("The maximum number of local streams that can be opened") public int getMaxTotalLocalStreams() -
setMaxTotalLocalStreams
public void setMaxTotalLocalStreams(int maxTotalLocalStreams) -
getMaxRemoteStreams
@ManagedAttribute("The maximum number of concurrent remote streams") public int getMaxRemoteStreams() -
setMaxRemoteStreams
public void setMaxRemoteStreams(int maxRemoteStreams) -
getStreamIdleTimeout
@ManagedAttribute("The stream\'s idle timeout") public long getStreamIdleTimeout() -
setStreamIdleTimeout
public void setStreamIdleTimeout(long streamIdleTimeout) -
getInitialSessionRecvWindow
@ManagedAttribute("The initial size of session\'s flow control receive window") public int getInitialSessionRecvWindow() -
setInitialSessionRecvWindow
public void setInitialSessionRecvWindow(int initialSessionRecvWindow) -
getWriteThreshold
@ManagedAttribute("The number of bytes that trigger a TCP write") public int getWriteThreshold() -
setWriteThreshold
public void setWriteThreshold(int writeThreshold) -
getMaxEncoderTableCapacity
@ManagedAttribute("The HPACK encoder dynamic table maximum capacity") public int getMaxEncoderTableCapacity() -
setMaxEncoderTableCapacity
public void setMaxEncoderTableCapacity(int maxEncoderTableCapacity) -
getEndPoint
public org.eclipse.jetty.io.EndPoint getEndPoint() -
getParser
-
getGenerator
-
getBytesWritten
public long getBytesWritten() -
onData
- Specified by:
onDatain interfaceParser.Listener
-
onData
-
isLocalStreamClosed
protected boolean isLocalStreamClosed(int streamId) -
isRemoteStreamClosed
protected boolean isRemoteStreamClosed(int streamId) -
onHeaders
- Specified by:
onHeadersin interfaceParser.Listener
-
onPriority
- Specified by:
onPriorityin interfaceParser.Listener
-
onReset
- Specified by:
onResetin interfaceParser.Listener
-
onResetForUnknownStream
-
onSettings
- Specified by:
onSettingsin interfaceParser.Listener
-
onSettings
-
onPing
- Specified by:
onPingin interfaceParser.Listener
-
onGoAway
This method is called when receiving a GO_AWAY from the other peer.
- Specified by:
onGoAwayin interfaceParser.Listener- Parameters:
frame- the GO_AWAY frame that has been received.- See Also:
-
onWindowUpdate
- Specified by:
onWindowUpdatein interfaceParser.Listener
-
onWindowUpdate
-
onStreamFailure
- Specified by:
onStreamFailurein interfaceParser.Listener
-
onConnectionFailure
- Specified by:
onConnectionFailurein interfaceParser.Listener
-
onWriteFailure
-
abort
-
newStream
public void newStream(HeadersFrame frame, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) Description copied from interface:SessionSends the given HEADERS
frameto create a newStream. -
newStream
public void newStream(HTTP2Stream.FrameList frames, org.eclipse.jetty.util.Promise<Stream> promise, Stream.Listener listener) -
newUpgradeStream
public Stream newUpgradeStream(HeadersFrame frame, Stream.Listener listener, Consumer<Throwable> failFn) Creates a new stream allocating a stream id if the given HEADERS frame does not have one.
- Parameters:
frame- the HEADERS frame that triggered the stream creation allocated stream id, or null if not interested in the modified headers framelistener- the listener that gets notified of stream events
-
newStream
protected HTTP2Stream newStream(int streamId, org.eclipse.jetty.http.MetaData.Request request, boolean local) -
priority
Description copied from interface:SessionSends the given PRIORITY
frame.If the
framereferences astreamIdthat does not exist (for example0), then a newstreamIdwill be allocated, to support unused anchor streams that act as parent for other streams. -
push
public void push(Stream stream, org.eclipse.jetty.util.Promise<Stream> promise, PushPromiseFrame frame, Stream.Listener listener) -
settings
Description copied from interface:SessionSends the given SETTINGS
frameto configure the session. -
ping
Description copied from interface:SessionSends the given PING
frame.PING frames may be used to test the connection integrity and to measure round-trip time.
-
close
Invoked internally and by applications to send a GO_AWAY frame to the other peer.
-
shutdown
Description copied from interface:SessionGracefully closes the session, returning a
CompletableFuturethat is completed when all the streams currently being processed are completed.Implementation is idempotent, i.e. calling this method a second time or concurrently results in a no-operation.
-
goAway
-
isClosed
-
getCloseState
-
frames
public void frames(HTTP2Stream stream, List<? extends Frame> frames, org.eclipse.jetty.util.Callback callback) -
data
-
createLocalStream
protected HTTP2Stream createLocalStream(int streamId, org.eclipse.jetty.http.MetaData.Request request, Consumer<Throwable> failFn) -
createRemoteStream
protected HTTP2Stream createRemoteStream(int streamId, org.eclipse.jetty.http.MetaData.Request request) -
removeStream
-
getStreams
- Specified by:
getStreamsin interfaceSession- Returns:
- a snapshot of all the streams currently belonging to this session
-
getStreamCount
@ManagedAttribute("The number of active streams") public int getStreamCount() -
getStream
Description copied from interface:SessionRetrieves the stream with the given
streamId. -
getLocalAddress
- Specified by:
getLocalAddressin interfaceSession- Returns:
- the local network address this session is bound to,
or
nullif this session is not bound to a network address
-
getLocalSocketAddress
- Specified by:
getLocalSocketAddressin interfaceSession- Returns:
- the local network address this session is bound to,
or
nullif this session is not bound to a network address
-
getRemoteAddress
- Specified by:
getRemoteAddressin interfaceSession- Returns:
- the remote network address this session is connected to,
or
nullif this session is not connected to a network address
-
getRemoteSocketAddress
- Specified by:
getRemoteSocketAddressin interfaceSession- Returns:
- the remote network address this session is connected to,
or
nullif this session is not connected to a network address
-
getSendWindow
@ManagedAttribute(value="The flow control send window", readonly=true) public int getSendWindow() -
getRecvWindow
@ManagedAttribute(value="The flow control receive window", readonly=true) public int getRecvWindow() -
updateSendWindow
public int updateSendWindow(int delta) -
updateRecvWindow
public int updateRecvWindow(int delta) -
isPushEnabled
@ManagedAttribute(value="Whether HTTP/2 push is enabled", readonly=true) public boolean isPushEnabled()- Specified by:
isPushEnabledin interfaceSession- Returns:
- whether the push functionality is enabled
-
isConnectProtocolEnabled
@ManagedAttribute(value="Whether CONNECT requests supports a protocol", readonly=true) public boolean isConnectProtocolEnabled() -
setConnectProtocolEnabled
public void setConnectProtocolEnabled(boolean connectProtocolEnabled) -
onShutdown
public void onShutdown()This method is called when the TCP FIN is received from the remote peer.
- See Also:
-
onIdleTimeout
public boolean onIdleTimeout()This method is invoked when the idle timeout expires.
- Returns:
- true if the session should be closed, false otherwise
- See Also:
-
onFrame
-
onStreamOpened
-
disconnect
public void disconnect() -
isDisconnected
public boolean isDisconnected() -
getLastRemoteStreamId
protected int getLastRemoteStreamId() -
updateLastRemoteStreamId
protected void updateLastRemoteStreamId(int streamId) -
notifyNewStream
-
notifySettings
-
notifyPing
-
notifyReset
-
notifyGoAway
-
notifyClose
protected void notifyClose(Session session, GoAwayFrame frame, org.eclipse.jetty.util.Callback callback) -
notifyIdleTimeout
-
notifyFailure
-
isClientStream
protected static boolean isClientStream(int streamId) -
dump
- Specified by:
dumpin interfaceorg.eclipse.jetty.util.component.Dumpable- Overrides:
dumpin classorg.eclipse.jetty.util.component.ContainerLifeCycle- Throws:
IOException
-
toString
- Overrides:
toStringin classorg.eclipse.jetty.util.component.AbstractLifeCycle
-