Class GatewayConnection

java.lang.Object
org.eclipse.jetty.io.AbstractConnection
org.eclipse.jetty.server.HttpConnection
com.zfabrik.gateway.worker.GatewayConnection
All Implemented Interfaces:
Closeable, AutoCloseable, Runnable, org.eclipse.jetty.io.Connection, org.eclipse.jetty.io.Connection.UpgradeFrom, org.eclipse.jetty.io.Connection.UpgradeTo, org.eclipse.jetty.io.WriteFlusher.Listener, org.eclipse.jetty.server.HttpTransport

public class GatewayConnection extends org.eclipse.jetty.server.HttpConnection
We use a special connection implementation so we can intercept the end of transmission and sneak in some extra payload that is consumed by the home GatewayServer and not sent to the actual client.

The extra-data, the appendix, contains the current sessionid and expiration time. We cannot reliably provide this information before the actual request is done, at which point the response may already be committed.

  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.eclipse.jetty.io.Connection

    org.eclipse.jetty.io.Connection.Listener, org.eclipse.jetty.io.Connection.UpgradeFrom, org.eclipse.jetty.io.Connection.UpgradeTo
  • Field Summary

    Fields inherited from class org.eclipse.jetty.server.HttpConnection

    CONNECTION_CLOSE

    Fields inherited from interface org.eclipse.jetty.server.HttpTransport

    UPGRADE_CONNECTION_ATTRIBUTE
  • Constructor Summary

    Constructors
    Constructor
    Description
    GatewayConnection​(org.eclipse.jetty.server.HttpConfiguration config, org.eclipse.jetty.server.Connector connector, org.eclipse.jetty.io.EndPoint endPoint)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
     
    void
     
    void
     
    void
    setAppendix​(String appendix)
     

    Methods inherited from class org.eclipse.jetty.server.HttpConnection

    abort, asyncReadFillInterested, getBeginNanoTime, getBytesIn, getBytesOut, getConnector, getCurrentConnection, getGenerator, getHttpChannel, getHttpConfiguration, getMessagesIn, getMessagesOut, getParser, getServer, isPushSupported, isRecordHttpComplianceViolations, isRequestBufferEmpty, isUseInputDirectByteBuffers, isUseOutputDirectByteBuffers, newHttpChannel, newHttpGenerator, newHttpParser, newRequestHandler, onClose, onFillInterestedFailed, onFlushed, onReadTimeout, onUpgradeFrom, onUpgradeTo, push, run, send, setCurrentConnection, setUseInputDirectByteBuffers, setUseOutputDirectByteBuffers, toConnectionString

    Methods inherited from class org.eclipse.jetty.io.AbstractConnection

    addEventListener, close, failedCallback, fillInterested, getCreatedTimeStamp, getEndPoint, getExecutor, getInputBufferSize, isFillInterested, onIdleExpired, removeEventListener, setInputBufferSize, toString, tryFillInterested

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • GatewayConnection

      public GatewayConnection(org.eclipse.jetty.server.HttpConfiguration config, org.eclipse.jetty.server.Connector connector, org.eclipse.jetty.io.EndPoint endPoint)
  • Method Details

    • setAppendix

      public void setAppendix(String appendix)
    • onCompleted

      public void onCompleted()
      Specified by:
      onCompleted in interface org.eclipse.jetty.server.HttpTransport
      Overrides:
      onCompleted in class org.eclipse.jetty.server.HttpConnection
    • onFillable

      public void onFillable()
      Overrides:
      onFillable in class org.eclipse.jetty.server.HttpConnection
    • onOpen

      public void onOpen()
      Specified by:
      onOpen in interface org.eclipse.jetty.io.Connection
      Overrides:
      onOpen in class org.eclipse.jetty.server.HttpConnection