public class HttpTransportOverHTTP2 extends Object implements HttpTransport
Constructor and Description |
---|
HttpTransportOverHTTP2(Connector connector,
HTTP2ServerConnection connection) |
Modifier and Type | Method and Description |
---|---|
void |
abort(Throwable failure)
Aborts this transport.
|
IStream |
getStream() |
boolean |
isOptimizedForDirectBuffers()
Is the underlying transport optimized for DirectBuffer usage
|
boolean |
isPushSupported() |
void |
onCompleted()
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.Response info,
boolean isHeadRequest,
ByteBuffer content,
boolean lastContent,
Callback callback)
Asynchronous call to send a response (or part) over the transport
|
void |
setStream(IStream stream) |
public HttpTransportOverHTTP2(Connector connector, HTTP2ServerConnection connection)
public boolean isOptimizedForDirectBuffers()
HttpTransport
isOptimizedForDirectBuffers
in interface HttpTransport
public IStream getStream()
public void setStream(IStream stream)
public void recycle()
public void send(MetaData.Response info, boolean isHeadRequest, ByteBuffer content, boolean lastContent, Callback callback)
HttpTransport
send
in interface HttpTransport
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.isHeadRequest
- 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 onpublic boolean isPushSupported()
isPushSupported
in interface HttpTransport
public void push(MetaData.Request request)
push
in interface HttpTransport
request
- A request to use as the basis for generating a pushed response.public void onStreamFailure(Throwable failure)
public boolean onStreamTimeout(Throwable failure)
public void onCompleted()
HttpTransport
onCompleted
in interface HttpTransport
public void abort(Throwable failure)
HttpTransport
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
abort
in interface HttpTransport
failure
- the failure that caused the abort.Copyright © 1995–2017 Webtide. All rights reserved.