Class HttpStreamOverFCGI

java.lang.Object
org.eclipse.jetty.fcgi.server.internal.HttpStreamOverFCGI
All Implemented Interfaces:
HttpStream, Callback, Invocable

public class HttpStreamOverFCGI extends Object implements HttpStream
  • Constructor Details

  • Method Details

    • getHttpChannel

      public HttpChannel getHttpChannel()
    • getId

      public String getId()
      Specified by:
      getId in interface HttpStream
      Returns:
      an ID unique within the lifetime scope of the associated protocol connection. This may be a protocol ID (e.g. HTTP/2 stream ID) or it may be unrelated to the protocol.
    • onHeader

      public void onHeader(HttpField field)
    • onHeaders

      public void onHeaders()
    • read

      public Content.Chunk read()
      Description copied from interface: HttpStream

      Reads a chunk of content, with the same semantic as Content.Source.read().

      This method is called from the implementation of Request.read().

      Specified by:
      read in interface HttpStream
      Returns:
      a chunk of content, possibly with non-null Content.Chunk.getFailure() or null.
    • demand

      public void demand()
      Description copied from interface: HttpStream

      Demands more content chunks to the underlying implementation.

      This method is called from the implementation of Request.demand(Runnable) and when the demand can be satisfied the implementation must call HttpChannel.onContentAvailable(). If there is a problem meeting demand, then the implementation must call HttpChannel.onFailure(Throwable).

      Specified by:
      demand in interface HttpStream
      See Also:
    • onContent

      public void onContent(Content.Chunk chunk)
    • onComplete

      public void onComplete()
    • prepareResponse

      public void prepareResponse(HttpFields.Mutable headers)
      Description copied from interface: HttpStream

      Prepare the response headers with respect to the stream. Typically this may set headers related to protocol specific behaviour (e.g. Keep-Alive for HTTP/1.0 connections).

      Specified by:
      prepareResponse in interface HttpStream
      Parameters:
      headers - The headers to prepare.
    • send

      public void send(MetaData.Request request, MetaData.Response response, boolean last, ByteBuffer byteBuffer, Callback callback)
      Description copied from interface: HttpStream

      Send response meta-data and/or data.

      Specified by:
      send in interface HttpStream
      Parameters:
      request - The request metadata for which the response should be sent.
      response - The response metadata to be sent or null if the response is already committed by a previous call to send.
      last - True if this will be the last call to send and the response can be completed.
      byteBuffer - A buffer of content to send or null if no content.
      callback - The callback to invoke when the send is completed successfully or in failure.
    • getIdleTimeout

      public long getIdleTimeout()
      Specified by:
      getIdleTimeout in interface HttpStream
    • setIdleTimeout

      public void setIdleTimeout(long idleTimeoutMs)
      Specified by:
      setIdleTimeout in interface HttpStream
    • isCommitted

      public boolean isCommitted()
      Specified by:
      isCommitted in interface HttpStream
    • consumeAvailable

      public Throwable consumeAvailable()
      Specified by:
      consumeAvailable in interface HttpStream
    • succeeded

      public void succeeded()
      Description copied from interface: Callback

      Callback invoked when the operation completes.

      Specified by:
      succeeded in interface Callback
      See Also:
    • failed

      public void failed(Throwable x)
      Description copied from interface: Callback

      Callback invoked when the operation fails.

      Specified by:
      failed in interface Callback
      Parameters:
      x - the reason for the operation failure
    • onIdleTimeout

      public boolean onIdleTimeout(TimeoutException timeout)
    • toString

      public String toString()
      Overrides:
      toString in class Object