Top Inners Fields Constructors Methods
org.eclipse.jetty.http3

public abstract Class HTTP3Session

extends ContainerLifeCycle
implements Session, ParserListener
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.http3.parser.ParserListener, org.eclipse.jetty.http3.api.Session
Imports
java.io.IOException, java.net.SocketAddress, java.nio.channels.ClosedChannelException, java.util.Collection, .Iterator, .List, .Map, java.util.concurrent.CompletableFuture, .ConcurrentHashMap, .TimeoutException, java.util.concurrent.atomic.AtomicInteger, .AtomicLong, java.util.function.Consumer, .Predicate, org.eclipse.jetty.http.MetaData, org.eclipse.jetty.http3.api.Session, .Stream, org.eclipse.jetty.http3.frames.DataFrame, .Frame, .GoAwayFrame, .HeadersFrame, .SettingsFrame, org.eclipse.jetty.http3.parser.ParserListener, org.eclipse.jetty.io.CyclicTimeouts, .EofException, org.eclipse.jetty.quic.common.ProtocolSession, .QuicStreamEndPoint, org.eclipse.jetty.util.Atomics, .Callback, .Promise, org.eclipse.jetty.util.component.ContainerLifeCycle, .DumpableCollection, org.eclipse.jetty.util.thread.AutoLock, .Scheduler, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
private class

Field Summary

Modifier and TypeField and Description
private HTTP3Session.CloseState
private GoAwayFrame
private GoAwayFrame
private final AtomicLong
private final Session.Listener
private final AutoLock
private static final Logger
private final ProtocolSession
private CompletableFuture<Void>
private final AtomicInteger
private long
private final Map<Long, HTTP3Stream>
private final HTTP3Session.StreamTimeouts
private Runnable

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected HTTP3Stream
public void
dump(Appendable out, String indent)

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines.

private void
failStreams(Predicate<HTTP3Stream> predicate, long error, String reason, boolean close, Throwable failure)

public long
public Session.Listener
public SocketAddress
getLocalSocketAddress()

Overrides default org.eclipse.jetty.http3.api.Session.getLocalSocketAddress.

Get the local socket address this session is bound to.

public int
protected HTTP3Stream
public ProtocolSession
public SocketAddress
getRemoteSocketAddress()

Overrides default org.eclipse.jetty.http3.api.Session.getRemoteSocketAddress.

Get the remote socket address this session is connected to.

protected HTTP3Stream
getStream(long streamId)

public long
public Collection<Stream>
public CompletableFuture<Void>
goAway(boolean graceful)

Overrides default org.eclipse.jetty.http3.api.Session.goAway.

Initiates the shutdown of this session by sending a GOAWAY frame to the other peer.

private CompletableFuture<Void>
public void
inwardClose(long
the close error
error
,
String
the close reason
reason
)

Called when a an external event wants to initiate the close of this session locally, for example a close at the network level (due to e.g. stopping a component) or a timeout.

public boolean
protected GoAwayFrame
newGoAwayFrame(boolean graceful)

private HTTP3Stream
newHTTP3Stream(QuicStreamEndPoint endPoint, Consumer<Throwable> fail, boolean local)

protected abstract HTTP3Stream
newHTTP3Stream(QuicStreamEndPoint endPoint, boolean local)

private void
notifyDisconnect(long error, String reason)

private void
notifyFailure(long error, String reason, Throwable failure)

private void
private boolean
private Map<Long, Long>
private void
public void
onClose(long
the close error
error
,
String
the close reason
reason
)

Called when the local peer receives a close initiated by the remote peer.

public void
public void
public void
onHeaders(long streamId, HeadersFrame frame, boolean wasBlocked)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onHeaders.

public boolean
public void
public Map<Long, Long>
public void
public void
public void
onStreamFailure(long streamId, long error, Throwable failure)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onStreamFailure.

private void
outwardClose(long
the close error
error
,
String
the close reason
reason
)

Propagates a close outwards, i.e. towards the network.

private void
outwardDisconnect(long
the close error
error
,
String
the close reason.
reason
)

Calls outwardClose(long, String), then notifies Session.Listener#onDisconnect(Session, long, String).

public void
pack-priv void
public void
setStreamIdleTimeout(long streamIdleTimeout)

public CompletableFuture<Void>
private void
terminate()

Terminates this session at the HTTP/3 level, and possibly notifies the shutdown callback.

private void
terminateAndDisconnect(long error, String reason)

public String
toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Returns a string representation of the object.

private void
private void
public abstract void
writeControlFrame(Frame frame, Callback callback)

public abstract void
writeMessageFrame(long streamId, Frame frame, Callback callback)

Inherited from org.eclipse.jetty.util.component.ContainerLifeCycle:
addBeanaddBeanaddEventListeneraddManagedcontainsdestroydoStartdoStopdumpdumpdumpObjectsdumpStdErrgetBeangetBeansgetBeansgetContainedBeansgetContainedBeansisAutoisManagedisUnmanagedmanageremoveBeanremoveBeansremoveEventListenersetBeansstartstopunmanageupdateBeanupdateBeanupdateBeansupdateBeans

Field Detail

closeStateback to summary
private HTTP3Session.CloseState closeState
goAwayRecvback to summary
private GoAwayFrame goAwayRecv
goAwaySentback to summary
private GoAwayFrame goAwaySent
lastStreamIdback to summary
private final AtomicLong lastStreamId
listenerback to summary
private final Session.Listener listener
lockback to summary
private final AutoLock lock
LOGback to summary
private static final Logger LOG

Hides org.eclipse.jetty.util.component.ContainerLifeCycle.LOG.

sessionback to summary
private final ProtocolSession session
shutdownback to summary
private CompletableFuture<Void> shutdown
streamCountback to summary
private final AtomicInteger streamCount
streamIdleTimeoutback to summary
private long streamIdleTimeout
streamsback to summary
private final Map<Long, HTTP3Stream> streams
streamTimeoutsback to summary
private final HTTP3Session.StreamTimeouts streamTimeouts
zeroStreamsActionback to summary
private Runnable zeroStreamsAction

Constructor Detail

HTTP3Sessionback to summary
public HTTP3Session(ProtocolSession session, Session.Listener listener)

Method Detail

createStreamback to summary
protected HTTP3Stream createStream(QuicStreamEndPoint endPoint, Consumer<Throwable> fail)
dumpback to summary
public void dump(Appendable out, String indent) throws IOException

Overrides org.eclipse.jetty.util.component.ContainerLifeCycle.dump.

Implements org.eclipse.jetty.util.component.Dumpable.dump.

Doc from org.eclipse.jetty.util.component.Dumpable.dump.

Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.

Annotations
@Override
Exceptions
IOException:
if unable to write to Appendable
failStreamsback to summary
private void failStreams(Predicate<HTTP3Stream> predicate, long error, String reason, boolean close, Throwable failure)
getIdleTimeoutback to summary
public long getIdleTimeout()
getListenerback to summary
public Session.Listener getListener()
getLocalSocketAddressback to summary
public SocketAddress getLocalSocketAddress()

Overrides default org.eclipse.jetty.http3.api.Session.getLocalSocketAddress.

Doc from org.eclipse.jetty.http3.api.Session.getLocalSocketAddress.

Get the local socket address this session is bound to.

Annotations
@Override
getMaxLocalStreamsback to summary
public int getMaxLocalStreams()
getOrCreateStreamback to summary
protected HTTP3Stream getOrCreateStream(QuicStreamEndPoint endPoint)
getProtocolSessionback to summary
public ProtocolSession getProtocolSession()
getRemoteSocketAddressback to summary
public SocketAddress getRemoteSocketAddress()

Overrides default org.eclipse.jetty.http3.api.Session.getRemoteSocketAddress.

Doc from org.eclipse.jetty.http3.api.Session.getRemoteSocketAddress.

Get the remote socket address this session is connected to.

Annotations
@Override
getStreamback to summary
protected HTTP3Stream getStream(long streamId)
getStreamIdleTimeoutback to summary
public long getStreamIdleTimeout()
getStreamsback to summary
public Collection<Stream> getStreams()

Overrides default org.eclipse.jetty.http3.api.Session.getStreams.

Annotations
@Override
goAwayback to summary
public CompletableFuture<Void> goAway(boolean graceful)

Overrides default org.eclipse.jetty.http3.api.Session.goAway.

Doc from org.eclipse.jetty.http3.api.Session.goAway.

Initiates the shutdown of this session by sending a GOAWAY frame to the other peer.

Annotations
@Override
goAwayback to summary
private CompletableFuture<Void> goAway(GoAwayFrame frame)
inwardCloseback to summary
public void inwardClose(long error, String reason)

Called when a an external event wants to initiate the close of this session locally, for example a close at the network level (due to e.g. stopping a component) or a timeout.

The correspondent passive event, where it's the remote peer that initiates the close, is delivered via onClose(long, String).

Parameters
error:long

the close error

reason:String

the close reason

See Also
onClose(long, String)
isClosedback to summary
public boolean isClosed()
newGoAwayFrameback to summary
protected GoAwayFrame newGoAwayFrame(boolean graceful)
newHTTP3Streamback to summary
private HTTP3Stream newHTTP3Stream(QuicStreamEndPoint endPoint, Consumer<Throwable> fail, boolean local)
newHTTP3Streamback to summary
protected abstract HTTP3Stream newHTTP3Stream(QuicStreamEndPoint endPoint, boolean local)
notifyDisconnectback to summary
private void notifyDisconnect(long error, String reason)
notifyFailureback to summary
private void notifyFailure(long error, String reason, Throwable failure)
notifyGoAwayback to summary
private void notifyGoAway(GoAwayFrame frame)
notifyIdleTimeoutback to summary
private boolean notifyIdleTimeout()
notifyPrefaceback to summary
private Map<Long, Long> notifyPreface()
notifySettingsback to summary
private void notifySettings(SettingsFrame frame)
onCloseback to summary
public void onClose(long error, String reason)

Called when the local peer receives a close initiated by the remote peer.

The correspondent active event, where it's the local peer that initiates the close, it's delivered via inwardClose(long, String).

Parameters
error:long

the close error

reason:String

the close reason

onDataback to summary
public void onData(long streamId, DataFrame frame)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onData.

Annotations
@Override
onGoAwayback to summary
public void onGoAway(GoAwayFrame frame)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onGoAway.

Annotations
@Override
onHeadersback to summary
public void onHeaders(long streamId, HeadersFrame frame, boolean wasBlocked)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onHeaders.

Annotations
@Override
onIdleTimeoutback to summary
public boolean onIdleTimeout()
onOpenback to summary
public void onOpen()
onPrefaceback to summary
public Map<Long, Long> onPreface()
onSessionFailureback to summary
public void onSessionFailure(long error, String reason, Throwable failure)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onSessionFailure.

Annotations
@Override
onSettingsback to summary
public void onSettings(SettingsFrame frame)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onSettings.

Annotations
@Override
onStreamFailureback to summary
public void onStreamFailure(long streamId, long error, Throwable failure)

Overrides default org.eclipse.jetty.http3.parser.ParserListener.onStreamFailure.

Annotations
@Override
outwardCloseback to summary
private void outwardClose(long error, String reason)

Propagates a close outwards, i.e. towards the network.

This method does not notify Session.Listener#onDisconnect(Session, long, String) so calling outwardDisconnect(long, String) is preferred.

Parameters
error:long

the close error

reason:String

the close reason

See Also
outwardDisconnect(long, String), inwardClose(long, String)
outwardDisconnectback to summary
private void outwardDisconnect(long error, String reason)

Calls outwardClose(long, String), then notifies Session.Listener#onDisconnect(Session, long, String).

Parameters
error:long

the close error

reason:String

the close reason.

See Also
outwardClose(long, String)
removeStreamback to summary
public void removeStream(HTTP3Stream stream, Throwable failure)
scheduleIdleTimeoutback to summary
pack-priv void scheduleIdleTimeout(HTTP3Stream stream)
setStreamIdleTimeoutback to summary
public void setStreamIdleTimeout(long streamIdleTimeout)
shutdownback to summary
public CompletableFuture<Void> shutdown()
terminateback to summary
private void terminate()

Terminates this session at the HTTP/3 level, and possibly notifies the shutdown callback. Termination at the QUIC level may still be in progress.

See Also
onClose(long, String), inwardClose(long, String)
terminateAndDisconnectback to summary
private void terminateAndDisconnect(long error, String reason)
toStringback to summary
public String toString()

Overrides org.eclipse.jetty.util.component.AbstractLifeCycle.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
tryRunZeroStreamsActionback to summary
private void tryRunZeroStreamsAction()
updateLastStreamIdback to summary
private void updateLastStreamId(long id)
writeControlFrameback to summary
public abstract void writeControlFrame(Frame frame, Callback callback)
writeMessageFrameback to summary
public abstract void writeMessageFrame(long streamId, Frame frame, Callback callback)
org.eclipse.jetty.http3 back to summary

private final Enum HTTP3Session.CloseState

extends Enum<HTTP3Session.CloseState>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final HTTP3Session.CloseState
public static final HTTP3Session.CloseState
public static final HTTP3Session.CloseState
public static final HTTP3Session.CloseState
public static final HTTP3Session.CloseState

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static HTTP3Session.CloseState
public static HTTP3Session.CloseState[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CLOSEDback to summary
public static final HTTP3Session.CloseState CLOSED
CLOSINGback to summary
public static final HTTP3Session.CloseState CLOSING
LOCALLY_CLOSEDback to summary
public static final HTTP3Session.CloseState LOCALLY_CLOSED
NOT_CLOSEDback to summary
public static final HTTP3Session.CloseState NOT_CLOSED
REMOTELY_CLOSEDback to summary
public static final HTTP3Session.CloseState REMOTELY_CLOSED

Constructor Detail

CloseStateback to summary
private CloseState()

Method Detail

valueOfback to summary
public static HTTP3Session.CloseState valueOf(String name)
valuesback to summary
public static HTTP3Session.CloseState[] values()
org.eclipse.jetty.http3 back to summary

private Class HTTP3Session.StreamTimeouts

extends CyclicTimeouts<HTTP3Stream>
Class Inheritance

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
protected Iterator<HTTP3Stream>
protected boolean
onExpired(HTTP3Stream stream)

Implements abstract org.eclipse.jetty.io.CyclicTimeouts.onExpired.

Invoked during the iteration when the given entity is expired.

Inherited from org.eclipse.jetty.io.CyclicTimeouts:
destroyschedule

Constructor Detail

StreamTimeoutsback to summary
private StreamTimeouts(Scheduler scheduler)

Method Detail

iteratorback to summary
protected Iterator<HTTP3Stream> iterator()

Implements abstract org.eclipse.jetty.io.CyclicTimeouts.iterator.

Annotations
@Override
onExpiredback to summary
protected boolean onExpired(HTTP3Stream stream)

Implements abstract org.eclipse.jetty.io.CyclicTimeouts.onExpired.

Doc from org.eclipse.jetty.io.CyclicTimeouts.onExpired.

Invoked during the iteration when the given entity is expired.

This method may be invoked multiple times, and even concurrently, for the same expirable entity and therefore the expiration of the entity, if any, should be an idempotent action.

When false is returned, the implementation should adjust the Expirable expiration, so that a call to Expirable#getExpireNanoTime() after this method has returned yields a new expiration nanoTime.

Annotations
@Override