Top Inners Fields Constructors Methods
org.eclipse.jetty.http2.server.internal

public Class HttpStreamOverHTTP2

extends Object
implements HttpStream, Server
Class Inheritance
All Implemented Interfaces
org.eclipse.jetty.http2.HTTP2Channel.Server, org.eclipse.jetty.server.HttpStream, org.eclipse.jetty.util.Callback, org.eclipse.jetty.util.thread.Invocable
Imports
java.nio.ByteBuffer, java.util.concurrent.TimeoutException, java.util.function.BiConsumer, .Supplier, org.eclipse.jetty.http.ComplianceViolation, .HttpCompliance, .HttpException, .HttpFields, .HttpMethod, .HttpStatus, .HttpVersion, .MetaData, .Trailers, org.eclipse.jetty.http2.ErrorCode, .HTTP2Channel, .HTTP2Stream, org.eclipse.jetty.http2.api.Stream, org.eclipse.jetty.http2.frames.DataFrame, .HeadersFrame, .PushPromiseFrame, .ResetFrame, org.eclipse.jetty.io.Connection, .Content, .EndPoint, org.eclipse.jetty.server.HttpChannel, .HttpStream, .Request, .TunnelSupport, org.eclipse.jetty.util.BufferUtil, .Callback, .Promise, org.eclipse.jetty.util.thread.AutoLock, .Invocable, org.slf4j.Logger, .LoggerFactory

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
private class

Field Summary

Modifier and TypeField and Description
private Content.Chunk
private final HTTP2ServerConnection
private boolean
private final HttpChannel
private MetaData.Request
private MetaData.Response
private final HTTP2Stream
private Content.Chunk
private boolean
private final AutoLock
private static final Logger
private TunnelSupport

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Throwable
private Content.Chunk
public void
demand()

Implements org.eclipse.jetty.server.HttpStream.demand.

Demands more content chunks to the underlying implementation.

public void
failed(Throwable
the reason for the operation failure
x
)

Overrides default org.eclipse.jetty.util.Callback.failed.

Callback invoked when the operation fails.

public String
public long
public TunnelSupport
public boolean
public boolean
private boolean
private void
public Runnable
public Runnable
public Runnable
public Runnable
public void
public Runnable
public void
prepareResponse(HttpFields.Mutable
The headers to prepare.
headers
)

Implements org.eclipse.jetty.server.HttpStream.prepareResponse.

Prepare the response headers with respect to the stream.

public void
push(MetaData.Request
the resource to push
resource
)

Overrides default org.eclipse.jetty.server.HttpStream.push.

Pushes the given resource to the client.

public Content.Chunk
read()

Implements org.eclipse.jetty.server.HttpStream.read.

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

private HttpFields
public void
send(MetaData.Request
The request metadata for which the response should be sent.
request
,
MetaData.Response
The response metadata to be sent or null if the response is already committed by a previous call to send.
response
,
boolean
True if this will be the last call to send and the response can be completed.
last
,
ByteBuffer
A buffer of content to send or null if no content.
byteBuffer
,
Callback
The callback to invoke when the send is completed successfully or in failure.
callback
)

Implements org.eclipse.jetty.server.HttpStream.send.

Send response meta-data and/or data.

private void
sendContent(MetaData.Request request, ByteBuffer content, boolean last, Callback callback)

private void
sendDataFrame(ByteBuffer content, boolean lastContent, boolean endStream, Callback callback)

private void
sendHeaders(MetaData.Request request, MetaData.Response response, ByteBuffer content, boolean last, Callback callback)

private void
sendTrailersFrame(MetaData metaData, Callback callback)

public void
public void
succeeded()

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Callback invoked when the operation completes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_chunkback to summary
private Content.Chunk _chunk
_connectionback to summary
private final HTTP2ServerConnection _connection
_demandback to summary
private boolean _demand
_httpChannelback to summary
private final HttpChannel _httpChannel
_requestMetaDataback to summary
private MetaData.Request _requestMetaData
_responseMetaDataback to summary
private MetaData.Response _responseMetaData
_streamback to summary
private final HTTP2Stream _stream
_trailerback to summary
private Content.Chunk _trailer
committedback to summary
private boolean committed
lockback to summary
private final AutoLock lock
LOGback to summary
private static final Logger LOG
tunnelSupportback to summary
private TunnelSupport tunnelSupport

Constructor Detail

HttpStreamOverHTTP2back to summary
public HttpStreamOverHTTP2(HTTP2ServerConnection connection, HttpChannel httpChannel, HTTP2Stream stream)

Method Detail

consumeAvailableback to summary
public Throwable consumeAvailable()

Implements org.eclipse.jetty.server.HttpStream.consumeAvailable.

Annotations
@Override
createChunkback to summary
private Content.Chunk createChunk(Stream.Data data)
demandback to summary
public void demand()

Implements org.eclipse.jetty.server.HttpStream.demand.

Doc from org.eclipse.jetty.server.HttpStream.demand.

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).

Annotations
@Override
failedback to summary
public void failed(Throwable x)

Overrides default org.eclipse.jetty.util.Callback.failed.

Doc from org.eclipse.jetty.util.Callback.failed.

Callback invoked when the operation fails.

Parameters
x:Throwable

the reason for the operation failure

Annotations
@Override
getIdback to summary
public String getId()

Implements org.eclipse.jetty.server.HttpStream.getId.

Returns:String

Doc from org.eclipse.jetty.server.HttpStream.getId.

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.

Annotations
@Override
getIdleTimeoutback to summary
public long getIdleTimeout()

Implements org.eclipse.jetty.server.HttpStream.getIdleTimeout.

Annotations
@Override
getTunnelSupportback to summary
public TunnelSupport getTunnelSupport()

Overrides default org.eclipse.jetty.server.HttpStream.getTunnelSupport.

Annotations
@Override
isCommittedback to summary
public boolean isCommitted()

Implements org.eclipse.jetty.server.HttpStream.isCommitted.

Annotations
@Override
isIdleback to summary
public boolean isIdle()

Implements org.eclipse.jetty.http2.HTTP2Channel.Server.isIdle.

Annotations
@Override
isTunnelback to summary
private boolean isTunnel(MetaData.Request request, MetaData.Response response)
onBadMessageback to summary
private void onBadMessage(HttpException x)
onDataAvailableback to summary
public Runnable onDataAvailable()

Implements org.eclipse.jetty.http2.HTTP2Channel.Server.onDataAvailable.

Annotations
@Override
onFailureback to summary
public Runnable onFailure(Throwable failure, Callback callback)

Implements org.eclipse.jetty.http2.HTTP2Channel.Server.onFailure.

Annotations
@Override
onPushRequestback to summary
public Runnable onPushRequest(MetaData.Request request)
onRequestback to summary
public Runnable onRequest(HeadersFrame frame)
onTimeoutback to summary
public void onTimeout(TimeoutException timeout, BiConsumer<Runnable, Boolean> consumer)

Implements org.eclipse.jetty.http2.HTTP2Channel.Server.onTimeout.

Annotations
@Override
onTrailerback to summary
public Runnable onTrailer(HeadersFrame frame)

Implements org.eclipse.jetty.http2.HTTP2Channel.Server.onTrailer.

Annotations
@Override
prepareResponseback to summary
public void prepareResponse(HttpFields.Mutable headers)

Implements org.eclipse.jetty.server.HttpStream.prepareResponse.

Doc from org.eclipse.jetty.server.HttpStream.prepareResponse.

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).

Parameters
headers:HttpFields.Mutable

The headers to prepare.

Annotations
@Override
pushback to summary
public void push(MetaData.Request resource)

Overrides default org.eclipse.jetty.server.HttpStream.push.

Doc from org.eclipse.jetty.server.HttpStream.push.

Pushes the given resource to the client.

Parameters
resource:MetaData.Request

the resource to push

Annotations
@Override
readback to summary
public Content.Chunk read()

Implements org.eclipse.jetty.server.HttpStream.read.

Doc from org.eclipse.jetty.server.HttpStream.read.

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

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

Returns:Content.Chunk

a chunk of content, possibly with non-null Chunk#getFailure() or null.

Annotations
@Override
retrieveTrailersback to summary
private HttpFields retrieveTrailers()
sendback to summary
public void send(MetaData.Request request, MetaData.Response response, boolean last, ByteBuffer byteBuffer, Callback callback)

Implements org.eclipse.jetty.server.HttpStream.send.

Doc from org.eclipse.jetty.server.HttpStream.send.

Send response meta-data and/or data.

Parameters
request:MetaData.Request

The request metadata for which the response should be sent.

response:MetaData.Response

The response metadata to be sent or null if the response is already committed by a previous call to send.

last:boolean

True if this will be the last call to send and the response can be completed.

byteBuffer:ByteBuffer

A buffer of content to send or null if no content.

callback:Callback

The callback to invoke when the send is completed successfully or in failure.

Annotations
@Override
sendContentback to summary
private void sendContent(MetaData.Request request, ByteBuffer content, boolean last, Callback callback)
sendDataFrameback to summary
private void sendDataFrame(ByteBuffer content, boolean lastContent, boolean endStream, Callback callback)
sendHeadersback to summary
private void sendHeaders(MetaData.Request request, MetaData.Response response, ByteBuffer content, boolean last, Callback callback)
sendTrailersFrameback to summary
private void sendTrailersFrame(MetaData metaData, Callback callback)
setIdleTimeoutback to summary
public void setIdleTimeout(long idleTimeoutMs)

Implements org.eclipse.jetty.server.HttpStream.setIdleTimeout.

Annotations
@Override
succeededback to summary
public void succeeded()

Overrides default org.eclipse.jetty.util.Callback.succeeded.

Doc from org.eclipse.jetty.util.Callback.succeeded.

Callback invoked when the operation completes.

Annotations
@Override
org.eclipse.jetty.http2.server.internal back to summary

private Class HttpStreamOverHTTP2.SendTrailers

extends Nested
Class Inheritance

Field Summary

Modifier and TypeField and Description
private final HttpFields

Constructor Summary

AccessConstructor and Description
private
SendTrailers(Callback callback, HttpFields trailers)

Method Summary

Modifier and TypeMethod and Description
public void
succeeded()

Overrides org.eclipse.jetty.util.Callback.Nested.succeeded.

Overrides default org.eclipse.jetty.util.Callback.Completing.succeeded.

Callback invoked when the operation completes.

Inherited from org.eclipse.jetty.util.Callback.Nested:
completedfailedgetCallbackgetInvocationTypetoString

Field Detail

trailersback to summary
private final HttpFields trailers

Constructor Detail

SendTrailersback to summary
private SendTrailers(Callback callback, HttpFields trailers)

Method Detail

succeededback to summary
public void succeeded()

Overrides org.eclipse.jetty.util.Callback.Nested.succeeded.

Overrides default org.eclipse.jetty.util.Callback.Completing.succeeded.

Doc from org.eclipse.jetty.util.Callback.succeeded.

Callback invoked when the operation completes.

Annotations
@Override
org.eclipse.jetty.http2.server.internal back to summary

private Class HttpStreamOverHTTP2.TunnelSupportOverHTTP2

extends Object
implements TunnelSupport
Class Inheritance
  • java.lang.Object
  • org.eclipse.jetty.http2.server.internal.HttpStreamOverHTTP2.TunnelSupportOverHTTP2
All Implemented Interfaces
org.eclipse.jetty.server.TunnelSupport

Field Summary

Modifier and TypeField and Description
private final EndPoint
private final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public EndPoint
getEndPoint()

Implements org.eclipse.jetty.server.TunnelSupport.getEndPoint.

Returns the EndPoint that should be used to carry the tunneled protocol.

public String
getProtocol()

Implements org.eclipse.jetty.server.TunnelSupport.getProtocol.

Returns the protocol of the CONNECT tunnel, or null if the tunnel transports HTTP or opaque bytes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

endPointback to summary
private final EndPoint endPoint
protocolback to summary
private final String protocol

Constructor Detail

TunnelSupportOverHTTP2back to summary
private TunnelSupportOverHTTP2(String protocol)

Method Detail

getEndPointback to summary
public EndPoint getEndPoint()

Implements org.eclipse.jetty.server.TunnelSupport.getEndPoint.

Doc from org.eclipse.jetty.server.TunnelSupport.getEndPoint.

Returns the EndPoint that should be used to carry the tunneled protocol.

Returns:EndPoint

the CONNECT tunnel EndPoint

Annotations
@Override
getProtocolback to summary
public String getProtocol()

Implements org.eclipse.jetty.server.TunnelSupport.getProtocol.

Doc from org.eclipse.jetty.server.TunnelSupport.getProtocol.

Returns the protocol of the CONNECT tunnel, or null if the tunnel transports HTTP or opaque bytes.

Returns:String

the CONNECT tunnel protocol, or null for HTTP

Annotations
@Override