public abstract class HttpExchangeBase extends Object implements HttpExchange, OutputChannel
| Modifier and Type | Field and Description |
|---|---|
protected PreCommitListener |
preCommitListener |
| Constructor and Description |
|---|
HttpExchangeBase() |
| Modifier and Type | Method and Description |
|---|---|
void |
addWriteFunction(WriteFunction listener) |
void |
endExchange() |
InputStream |
getInputStream() |
OutputChannel |
getOutputChannel() |
OutputStream |
getOutputStream() |
long |
getResponseBytesSent() |
boolean |
isComplete()
Returns true if the completion handler for this exchange has been invoked, and the request is considered
finished.
|
boolean |
isRequestComplete()
Returns true if all data has been read from the request, or if there
was not data.
|
protected boolean |
isRequestEntityBodyAllowed() |
boolean |
isResponseComplete() |
protected boolean |
isResponseEntityBodyAllowed() |
protected boolean |
isResponseStarted() |
void |
setBlockingHttpExchange(BlockingHttpExchange exchange) |
void |
setCompletedListener(CompletedListener listener) |
void |
setPreCommitListener(PreCommitListener listener) |
protected void |
terminateRequest()
Force the codec to treat the request as fully read.
|
protected void |
terminateResponse()
Force the codec to treat the response as fully written.
|
<T> void |
writeAsync(io.netty.buffer.ByteBuf data,
boolean last,
IoCallback<T> callback,
T context) |
void |
writeAsync(String data)
Writes the given UTF-8 data and ends the exchange
|
void |
writeAsync(String data,
Charset charset)
Writes the given data in the provided charset and ends the exchange
|
<T> void |
writeAsync(String data,
Charset charset,
boolean last,
IoCallback<T> callback,
T context)
Writes the given data in the provided charset and invokes the provided callback on completion
|
protected abstract <T> void |
writeAsync0(io.netty.buffer.ByteBuf data,
boolean last,
IoCallback<T> callback,
T context) |
void |
writeBlocking(io.netty.buffer.ByteBuf data,
boolean last) |
protected abstract void |
writeBlocking0(io.netty.buffer.ByteBuf data,
boolean last) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddRequestHeader, addResponseHeader, clearRequestHeaders, clearResponseHeaders, close, containsRequestHeader, containsResponseHeader, discardRequest, getBufferAllocator, getDestinationAddress, getInputChannel, getIoThread, getMaxEntitySize, getProtocol, getReadTimeout, getRequestContentLength, getRequestHeader, getRequestHeaderNames, getRequestHeaders, getRequestMethod, getRequestScheme, getRequestURI, getResponseContentLength, getResponseHeader, getResponseHeaderNames, getResponseHeaders, getSourceAddress, getSslSessionInfo, getStatusCode, getUndertowOptions, getWorker, isInIoThread, isIoOperationQueued, isPushSupported, isRequestTrailerFieldsSupported, isUpgrade, isUpgradeSupported, pushResource, removeRequestHeader, removeResponseHeader, sendContinue, setMaxEntitySize, setReadTimeout, setRequestHeader, setResponseHeader, setStatusCode, setUpgradeListenerprotected PreCommitListener preCommitListener
public void setCompletedListener(CompletedListener listener)
setCompletedListener in interface HttpExchangepublic void setPreCommitListener(PreCommitListener listener)
setPreCommitListener in interface HttpExchangeprotected void terminateRequest()
protected void terminateResponse()
public void setBlockingHttpExchange(BlockingHttpExchange exchange)
setBlockingHttpExchange in interface HttpExchangepublic OutputStream getOutputStream()
getOutputStream in interface HttpExchangepublic InputStream getInputStream()
getInputStream in interface HttpExchangepublic boolean isComplete()
isComplete in interface HttpExchangepublic boolean isRequestComplete()
isRequestComplete in interface HttpExchangepublic boolean isResponseComplete()
isResponseComplete in interface HttpExchangepublic void endExchange()
endExchange in interface HttpExchangepublic final void writeAsync(String data)
OutputChannelwriteAsync in interface OutputChanneldata - The data to writepublic final void writeAsync(String data, Charset charset)
OutputChannelwriteAsync in interface OutputChanneldata - The data to writepublic final <T> void writeAsync(String data, Charset charset, boolean last, IoCallback<T> callback, T context)
OutputChannelwriteAsync in interface OutputChanneldata - The data to writepublic void addWriteFunction(WriteFunction listener)
addWriteFunction in interface HttpExchangepublic OutputChannel getOutputChannel()
getOutputChannel in interface HttpExchangeprotected boolean isResponseStarted()
public final <T> void writeAsync(io.netty.buffer.ByteBuf data,
boolean last,
IoCallback<T> callback,
T context)
writeAsync in interface OutputChannelprotected abstract <T> void writeAsync0(io.netty.buffer.ByteBuf data,
boolean last,
IoCallback<T> callback,
T context)
public final void writeBlocking(io.netty.buffer.ByteBuf data,
boolean last)
throws IOException
writeBlocking in interface OutputChannelIOExceptionprotected abstract void writeBlocking0(io.netty.buffer.ByteBuf data,
boolean last)
throws IOException
IOExceptionpublic long getResponseBytesSent()
getResponseBytesSent in interface HttpExchangeprotected boolean isResponseEntityBodyAllowed()
protected boolean isRequestEntityBodyAllowed()
Copyright © 2020 JBoss by Red Hat. All rights reserved.