Class HttpConnection

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

Deprecated.
The Eclipse Jetty and Apache Felix Http Jetty packages are no longer supported.

A Connection that handles the HTTP protocol.

  • Field Details

    • CONNECTION_CLOSE

      public static final HttpField CONNECTION_CLOSE
      Deprecated.
    • UPGRADE_CONNECTION_ATTRIBUTE

      public static final String UPGRADE_CONNECTION_ATTRIBUTE
      Deprecated.
      See Also:
  • Constructor Details

  • Method Details

    • getCurrentConnection

      public static HttpConnection getCurrentConnection()
      Deprecated.
      Get the current connection that this thread is dispatched to. Note that a thread may be processing a request asynchronously and thus not be dispatched to the connection.
      Returns:
      the current HttpConnection or null
      See Also:
    • getHttpCompliance

      @Deprecated public HttpCompliance getHttpCompliance()
      Deprecated.
    • getHttpConfiguration

      public HttpConfiguration getHttpConfiguration()
      Deprecated.
    • isRecordHttpComplianceViolations

      public boolean isRecordHttpComplianceViolations()
      Deprecated.
    • getServer

      public Server getServer()
      Deprecated.
    • getConnector

      public Connector getConnector()
      Deprecated.
    • getHttpChannel

      public HttpChannel getHttpChannel()
      Deprecated.
    • getParser

      public HttpParser getParser()
      Deprecated.
    • getGenerator

      public HttpGenerator getGenerator()
      Deprecated.
    • isOptimizedForDirectBuffers

      public boolean isOptimizedForDirectBuffers()
      Deprecated.
      Description copied from interface: HttpTransport
      Is the underlying transport optimized for DirectBuffer usage
      Specified by:
      isOptimizedForDirectBuffers in interface HttpTransport
      Returns:
      True if direct buffers can be used optimally.
    • getMessagesIn

      public long getMessagesIn()
      Deprecated.
      Specified by:
      getMessagesIn in interface Connection
      Overrides:
      getMessagesIn in class AbstractConnection
    • getMessagesOut

      public long getMessagesOut()
      Deprecated.
      Specified by:
      getMessagesOut in interface Connection
      Overrides:
      getMessagesOut in class AbstractConnection
    • onUpgradeFrom

      public ByteBuffer onUpgradeFrom()
      Deprecated.
      Description copied from interface: Connection.UpgradeFrom

      Invoked during an upgrade to produce a buffer containing bytes that have not been consumed by this connection, and that must be consumed by the upgrade-to connection.

      Specified by:
      onUpgradeFrom in interface Connection.UpgradeFrom
      Returns:
      a buffer of unconsumed bytes to pass to the upgrade-to connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes. The returned buffer may be null if there are no unconsumed bytes.
    • onUpgradeTo

      public void onUpgradeTo(ByteBuffer buffer)
      Deprecated.
      Description copied from interface: Connection.UpgradeTo

      Invoked during an upgrade to receive a buffer containing bytes that have not been consumed by the upgrade-from connection, and that must be consumed by this connection.

      Specified by:
      onUpgradeTo in interface Connection.UpgradeTo
      Parameters:
      buffer - a non-null buffer of unconsumed bytes received from the upgrade-from connection. The buffer does not belong to any pool and should be discarded after having consumed its bytes.
    • onFlushed

      public void onFlushed(long bytes) throws IOException
      Deprecated.
      Description copied from interface: WriteFlusher.Listener

      Invoked when a WriteFlusher flushed bytes in a non-blocking way, as part of a - possibly larger - write.

      This method may be invoked multiple times, for example when writing a large buffer: a first flush of bytes, then the connection became TCP congested, and a subsequent flush of bytes when the connection became writable again.

      This method is never invoked concurrently, but may be invoked by different threads, so implementations may not rely on thread-local variables.

      Implementations may throw an IOException to signal that the write should fail, for example if the implementation enforces a minimum data rate.

      Specified by:
      onFlushed in interface WriteFlusher.Listener
      Parameters:
      bytes - the number of bytes flushed
      Throws:
      IOException - if the write should fail
    • getRequestBuffer

      public ByteBuffer getRequestBuffer()
      Deprecated.
    • isRequestBufferEmpty

      public boolean isRequestBufferEmpty()
      Deprecated.
    • onFillable

      public void onFillable()
      Deprecated.
      Description copied from class: AbstractConnection

      Callback method invoked when the endpoint is ready to be read.

      Specified by:
      onFillable in class AbstractConnection
      See Also:
    • onCompleted

      public void onCompleted()
      Deprecated.
      Description copied from interface: HttpTransport
      Called to indicated the end of the current request/response cycle (which may be some time after the last content is sent).
      Specified by:
      onCompleted in interface HttpTransport
    • onOpen

      public void onOpen()
      Deprecated.
      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 interface Connection
      Overrides:
      onOpen in class AbstractConnection
    • onClose

      public void onClose()
      Deprecated.
      Description copied from interface: Connection

      Callback method invoked when this connection is closed.

      Creators of the connection implementation are responsible for calling this method.

      Specified by:
      onClose in interface Connection
      Overrides:
      onClose in class AbstractConnection
    • run

      public void run()
      Deprecated.
      Specified by:
      run in interface Runnable
    • send

      public void send(MetaData.Response info, boolean head, ByteBuffer content, boolean lastContent, Callback callback)
      Deprecated.
      Description copied from interface: HttpTransport
      Asynchronous call to send a response (or part) over the transport
      Specified by:
      send in interface HttpTransport
      Parameters:
      info - The header info to send, or null if just sending more data. The first call to send for a response must have a non null info.
      head - True if the response if for a HEAD request (and the data should not be sent).
      content - A buffer of content to be sent.
      lastContent - True if the content is the last content for the current response.
      callback - The Callback instance that success or failure of the send is notified on
    • abort

      public void abort(Throwable failure)
      Deprecated.
      Description copied from interface: HttpTransport
      Aborts this transport.

      This method should terminate the transport in a way that can indicate an abnormal response to the client, for example by abruptly close the connection.

      This method is called when an error response needs to be sent, but the response is already committed, or when a write failure is detected. If abort is called, HttpTransport.onCompleted() is not called

      Specified by:
      abort in interface HttpTransport
      Parameters:
      failure - the failure that caused the abort.
    • isPushSupported

      public boolean isPushSupported()
      Deprecated.
      Specified by:
      isPushSupported in interface HttpTransport
      Returns:
      true if responses can be pushed over this transport
    • push

      public void push(MetaData.Request request)
      Deprecated.
      Specified by:
      push in interface HttpTransport
      Parameters:
      request - A request to use as the basis for generating a pushed response.
    • asyncReadFillInterested

      public void asyncReadFillInterested()
      Deprecated.
    • blockingReadFillInterested

      public void blockingReadFillInterested()
      Deprecated.
    • blockingReadFailure

      public void blockingReadFailure(Throwable e)
      Deprecated.
    • getBytesIn

      public long getBytesIn()
      Deprecated.
      Specified by:
      getBytesIn in interface Connection
      Overrides:
      getBytesIn in class AbstractConnection
    • getBytesOut

      public long getBytesOut()
      Deprecated.
      Specified by:
      getBytesOut in interface Connection
      Overrides:
      getBytesOut in class AbstractConnection
    • toConnectionString

      public String toConnectionString()
      Deprecated.
      Overrides:
      toConnectionString in class AbstractConnection