java.lang.Object
org.eclipse.jetty.util.component.AbstractLifeCycle
org.eclipse.jetty.util.component.ContainerLifeCycle
org.eclipse.jetty.http3.internal.HTTP3Session
All Implemented Interfaces:
Session, ParserListener, 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

public abstract class HTTP3Session extends org.eclipse.jetty.util.component.ContainerLifeCycle implements Session, ParserListener
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    org.eclipse.jetty.util.component.AbstractLifeCycle.AbstractLifeCycleListener, org.eclipse.jetty.util.component.AbstractLifeCycle.StopException

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Container

    org.eclipse.jetty.util.component.Container.InheritedListener, org.eclipse.jetty.util.component.Container.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable

    org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.LifeCycle

    org.eclipse.jetty.util.component.LifeCycle.Listener

    Nested classes/interfaces inherited from interface org.eclipse.jetty.http3.internal.parser.ParserListener

    ParserListener.Wrapper

    Nested classes/interfaces inherited from interface org.eclipse.jetty.http3.api.Session

    Session.Client, Session.Listener, Session.Server
  • Field Summary

    Fields inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    FAILED, STARTED, STARTING, STOPPED, STOPPING

    Fields inherited from interface org.eclipse.jetty.util.component.Dumpable

    KEY
  • Constructor Summary

    Constructors
    Constructor
    Description
    HTTP3Session(org.eclipse.jetty.quic.common.ProtocolSession session, Session.Listener listener)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected HTTP3Stream
    createStream(org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint, Consumer<Throwable> fail)
     
    void
    dump(Appendable out, String indent)
     
    long
     
     
     
    int
     
    protected HTTP3Stream
    getOrCreateStream(org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint)
     
    org.eclipse.jetty.quic.common.ProtocolSession
     
     
    protected HTTP3Stream
    getStream(long streamId)
     
    long
     
     
    goAway(boolean graceful)
    Initiates the shutdown of this session by sending a GOAWAY frame to the other peer.
    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.
    boolean
     
    protected GoAwayFrame
    newGoAwayFrame(boolean graceful)
     
    protected abstract HTTP3Stream
    newHTTP3Stream(org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint, boolean local)
     
    void
    onClose(long error, String reason)
    Called when the local peer receives a close initiated by the remote peer.
    void
    onData(long streamId, DataFrame frame)
     
    void
    onDataAvailable(long streamId)
     
    void
     
    void
    onHeaders(long streamId, HeadersFrame frame, boolean wasBlocked)
     
    boolean
     
    void
     
     
    void
    onSessionFailure(long error, String reason, Throwable failure)
     
    void
     
    void
    onStreamFailure(long streamId, long error, Throwable failure)
     
    void
     
    void
    setStreamIdleTimeout(long streamIdleTimeout)
     
     
     
    abstract void
    writeControlFrame(Frame frame, org.eclipse.jetty.util.Callback callback)
     
    abstract void
    writeMessageFrame(long streamId, Frame frame, org.eclipse.jetty.util.Callback callback)
     

    Methods inherited from class org.eclipse.jetty.util.component.ContainerLifeCycle

    addBean, addBean, addEventListener, addManaged, contains, destroy, doStart, doStop, dump, dump, dumpObjects, dumpStdErr, getBean, getBeans, getBeans, getContainedBeans, getContainedBeans, isAuto, isManaged, isUnmanaged, manage, removeBean, removeBeans, removeEventListener, setBeans, start, stop, unmanage, updateBean, updateBean, updateBeans, updateBeans

    Methods inherited from class org.eclipse.jetty.util.component.AbstractLifeCycle

    getEventListeners, getState, getState, isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, setEventListeners, start, stop

    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.component.Container

    getCachedBeans, getEventListeners

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable

    dumpSelf

    Methods inherited from interface org.eclipse.jetty.util.component.Dumpable.DumpableContainer

    isDumpable
  • Constructor Details

    • HTTP3Session

      public HTTP3Session(org.eclipse.jetty.quic.common.ProtocolSession session, Session.Listener listener)
  • Method Details

    • getProtocolSession

      public org.eclipse.jetty.quic.common.ProtocolSession getProtocolSession()
    • getListener

      public Session.Listener getListener()
    • onOpen

      public void onOpen()
    • getLocalSocketAddress

      public SocketAddress getLocalSocketAddress()
      Specified by:
      getLocalSocketAddress in interface Session
      Returns:
      the local socket address this session is bound to
    • getRemoteSocketAddress

      public SocketAddress getRemoteSocketAddress()
      Specified by:
      getRemoteSocketAddress in interface Session
      Returns:
      the remote socket address this session is connected to
    • getStreams

      public Collection<Stream> getStreams()
      Specified by:
      getStreams in interface Session
      Returns:
      a snapshot of all the streams currently belonging to this session
    • getMaxLocalStreams

      public int getMaxLocalStreams()
    • goAway

      public CompletableFuture<Void> goAway(boolean graceful)
      Description copied from interface: Session

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

      Specified by:
      goAway in interface Session
      Parameters:
      graceful - whether the shutdown should be graceful
      Returns:
      the CompletableFuture that gets notified when the frame has been sent
    • newGoAwayFrame

      protected GoAwayFrame newGoAwayFrame(boolean graceful)
    • shutdown

      public CompletableFuture<Void> shutdown()
    • getIdleTimeout

      public long getIdleTimeout()
    • getStreamIdleTimeout

      public long getStreamIdleTimeout()
    • setStreamIdleTimeout

      public void setStreamIdleTimeout(long streamIdleTimeout)
    • createStream

      protected HTTP3Stream createStream(org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint, Consumer<Throwable> fail)
    • getOrCreateStream

      protected HTTP3Stream getOrCreateStream(org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint)
    • newHTTP3Stream

      protected abstract HTTP3Stream newHTTP3Stream(org.eclipse.jetty.quic.common.QuicStreamEndPoint endPoint, boolean local)
    • getStream

      protected HTTP3Stream getStream(long streamId)
    • removeStream

      public void removeStream(HTTP3Stream stream, Throwable failure)
    • writeControlFrame

      public abstract void writeControlFrame(Frame frame, org.eclipse.jetty.util.Callback callback)
    • writeMessageFrame

      public abstract void writeMessageFrame(long streamId, Frame frame, org.eclipse.jetty.util.Callback callback)
    • onPreface

      public Map<Long,Long> onPreface()
    • onSettings

      public void onSettings(SettingsFrame frame)
      Specified by:
      onSettings in interface ParserListener
    • onHeaders

      public void onHeaders(long streamId, HeadersFrame frame, boolean wasBlocked)
      Specified by:
      onHeaders in interface ParserListener
    • onData

      public void onData(long streamId, DataFrame frame)
      Specified by:
      onData in interface ParserListener
    • onDataAvailable

      public void onDataAvailable(long streamId)
    • onGoAway

      public void onGoAway(GoAwayFrame frame)
      Specified by:
      onGoAway in interface ParserListener
    • onIdleTimeout

      public boolean onIdleTimeout()
    • inwardClose

      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 - the close error
      reason - the close reason
      See Also:
    • onClose

      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 - the close error
      reason - the close reason
    • onStreamFailure

      public void onStreamFailure(long streamId, long error, Throwable failure)
      Specified by:
      onStreamFailure in interface ParserListener
    • onSessionFailure

      public void onSessionFailure(long error, String reason, Throwable failure)
      Specified by:
      onSessionFailure in interface ParserListener
    • isClosed

      public boolean isClosed()
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Specified by:
      dump in interface org.eclipse.jetty.util.component.Dumpable
      Overrides:
      dump in class org.eclipse.jetty.util.component.ContainerLifeCycle
      Throws:
      IOException
    • toString

      public String toString()
      Overrides:
      toString in class org.eclipse.jetty.util.component.AbstractLifeCycle