Class HttpStream.Wrapper

java.lang.Object
org.eclipse.jetty.server.HttpStream.Wrapper
All Implemented Interfaces:
HttpStream, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.thread.Invocable
Enclosing interface:
HttpStream

public static class HttpStream.Wrapper extends Object implements HttpStream
  • Nested Class Summary

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

    org.eclipse.jetty.util.Callback.Completable, org.eclipse.jetty.util.Callback.Completing, org.eclipse.jetty.util.Callback.Nested

    Nested classes/interfaces inherited from interface org.eclipse.jetty.server.HttpStream

    HttpStream.Wrapper

    Nested classes/interfaces inherited from interface org.eclipse.jetty.util.thread.Invocable

    org.eclipse.jetty.util.thread.Invocable.Callable, org.eclipse.jetty.util.thread.Invocable.InvocationType, org.eclipse.jetty.util.thread.Invocable.ReadyTask, org.eclipse.jetty.util.thread.Invocable.Task
  • Field Summary

    Fields inherited from interface org.eclipse.jetty.util.Callback

    NOOP

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

    CONTENT_NOT_CONSUMED, UPGRADE_CONNECTION_ATTRIBUTE

    Fields inherited from interface org.eclipse.jetty.util.thread.Invocable

    __nonBlocking
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    final Throwable
     
    void
    Demands more content chunks to the underlying implementation.
    void
     
    final String
     
    long
     
    org.eclipse.jetty.util.thread.Invocable.InvocationType
     
     
     
    final boolean
     
    void
    prepareResponse(org.eclipse.jetty.http.HttpFields.Mutable headers)
    Prepare the response headers with respect to the stream.
    void
    push(org.eclipse.jetty.http.MetaData.Request resource)
    Pushes the given resource to the client.
    org.eclipse.jetty.io.Content.Chunk
    Reads a chunk of content, with the same semantic as Content.Source.read().
    void
    send(org.eclipse.jetty.http.MetaData.Request request, org.eclipse.jetty.http.MetaData.Response response, boolean last, ByteBuffer content, org.eclipse.jetty.util.Callback callback)
    Send response meta-data and/or data.
    void
    setIdleTimeout(long idleTimeoutMs)
     
    void
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.eclipse.jetty.util.Callback

    completeWith
  • Constructor Details

  • Method Details

    • getWrapped

      public HttpStream getWrapped()
    • getId

      public final 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.
    • read

      public org.eclipse.jetty.io.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:
    • prepareResponse

      public void prepareResponse(org.eclipse.jetty.http.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(org.eclipse.jetty.http.MetaData.Request request, org.eclipse.jetty.http.MetaData.Response response, boolean last, ByteBuffer content, org.eclipse.jetty.util.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.
      content - 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.
    • push

      public void push(org.eclipse.jetty.http.MetaData.Request resource)
      Description copied from interface: HttpStream

      Pushes the given resource to the client.

      Specified by:
      push in interface HttpStream
      Parameters:
      resource - the resource to push
      See Also:
    • getIdleTimeout

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

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

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

      public TunnelSupport getTunnelSupport()
      Specified by:
      getTunnelSupport in interface HttpStream
    • consumeAvailable

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

      public void succeeded()
      Specified by:
      succeeded in interface org.eclipse.jetty.util.Callback
    • failed

      public void failed(Throwable x)
      Specified by:
      failed in interface org.eclipse.jetty.util.Callback
    • getInvocationType

      public org.eclipse.jetty.util.thread.Invocable.InvocationType getInvocationType()
      Specified by:
      getInvocationType in interface org.eclipse.jetty.util.thread.Invocable