Package org.eclipse.jetty.http2.server
Class HttpTransportOverHTTP2
java.lang.Object
org.eclipse.jetty.http2.server.HttpTransportOverHTTP2
- All Implemented Interfaces:
HttpTransport
-
Field Summary
Fields inherited from interface org.eclipse.jetty.server.HttpTransport
UPGRADE_CONNECTION_ATTRIBUTE
-
Constructor Summary
ConstructorDescriptionHttpTransportOverHTTP2
(Connector connector, HTTP2ServerConnection connection) -
Method Summary
Modifier and TypeMethodDescriptionvoid
Aborts this transport.boolean
void
Called to indicated the end of the current request/response cycle (which may be some time after the last content is sent).void
onStreamFailure
(Throwable failure) boolean
onStreamTimeout
(Throwable failure) void
push
(MetaData.Request request) void
recycle()
void
send
(MetaData.Request request, MetaData.Response response, ByteBuffer content, boolean lastContent, Callback callback) Asynchronous call to send a response (or part) over the transportvoid
sendContent
(MetaData.Request request, ByteBuffer content, boolean lastContent, Callback callback) void
sendHeaders
(MetaData.Request request, MetaData.Response response, ByteBuffer content, boolean lastContent, Callback callback) void
-
Constructor Details
-
HttpTransportOverHTTP2
-
-
Method Details
-
getStream
-
setStream
-
recycle
public void recycle() -
send
public void send(MetaData.Request request, MetaData.Response response, ByteBuffer content, boolean lastContent, Callback callback) Description copied from interface:HttpTransport
Asynchronous call to send a response (or part) over the transport- Specified by:
send
in interfaceHttpTransport
- Parameters:
request
- True if the response if for a HEAD request (and the data should not be sent).response
- 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.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
-
sendHeaders
public void sendHeaders(MetaData.Request request, MetaData.Response response, ByteBuffer content, boolean lastContent, Callback callback) -
sendContent
public void sendContent(MetaData.Request request, ByteBuffer content, boolean lastContent, Callback callback) -
isPushSupported
public boolean isPushSupported()- Specified by:
isPushSupported
in interfaceHttpTransport
- Returns:
- true if responses can be pushed over this transport
-
push
- Specified by:
push
in interfaceHttpTransport
- Parameters:
request
- A request to use as the basis for generating a pushed response.
-
onStreamFailure
-
onStreamTimeout
-
onCompleted
public void onCompleted()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 interfaceHttpTransport
-
abort
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 interfaceHttpTransport
- Parameters:
failure
- the failure that caused the abort.
-