Package io.undertow.httpcore
Interface HttpExchange
- All Superinterfaces:
AutoCloseable,Closeable
- All Known Implementing Classes:
HttpExchangeBase
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddRequestHeader(String name, String value) voidaddResponseHeader(String name, String value) voidaddWriteFunction(WriteFunction listener) voidvoidvoidclose()booleancontainsRequestHeader(String name) booleancontainsResponseHeader(String name) voidvoidio.netty.util.concurrent.EventExecutorlonglongdefault longgetRequestHeader(String name) Gets the first request header with the given namegetRequestHeaders(String name) Gets request headers with the given nameGet the HTTP request methodGet the request URI scheme.The original request URI.longdefault longgetResponseHeader(String name) Gets the first response header with the given namegetResponseHeaders(String name) Gets response headers with the given nameintbooleanbooleanisHttp2()booleanbooleandefault booleanbooleanReturns true if all data has been read from the request, or if there was not data.default booleanbooleandefault booleanbooleandefault voidvoidremoveRequestHeader(String name) voidremoveResponseHeader(String name) voidvoidsetBlockingHttpExchange(BlockingHttpExchange exchange) voidsetCompletedListener(CompletedListener listener) voidsetMaxEntitySize(long maxEntitySize) voidsetPreCommitListener(PreCommitListener listener) voidsetReadTimeout(long readTimeoutMs) voidsetRequestHeader(String name, String value) voidsetResponseHeader(String name, String value) setStatusCode(int code) voidsetUndertowOptions(UndertowOptionMap options) voidsetUpgradeListener(Consumer<Object> listener)
-
Method Details
-
getBufferAllocator
BufferAllocator getBufferAllocator() -
setStatusCode
-
getStatusCode
int getStatusCode() -
getRequestHeader
Gets the first request header with the given name- Parameters:
name- The header name- Returns:
- The header value, or null if it is not present
-
getRequestHeaders
Gets request headers with the given name- Parameters:
name- The header name- Returns:
- The header value, or an empty list if none are present
-
containsRequestHeader
-
removeRequestHeader
-
setRequestHeader
-
getRequestHeaderNames
Collection<String> getRequestHeaderNames() -
addRequestHeader
-
clearRequestHeaders
void clearRequestHeaders() -
getResponseHeaders
Gets response headers with the given name- Parameters:
name- The header name- Returns:
- The header value, or an empty list if none are present
-
containsResponseHeader
-
removeResponseHeader
-
setResponseHeader
-
getResponseHeaderNames
Collection<String> getResponseHeaderNames() -
addResponseHeader
-
clearResponseHeaders
void clearResponseHeaders() -
getResponseHeader
Gets the first response header with the given name- Parameters:
name- The header name- Returns:
- The header value, or null if it is not present
-
setCompletedListener
-
setPreCommitListener
-
getRequestContentLength
default long getRequestContentLength()- Returns:
- The content length of the request, or
-1if it has not been set
-
getResponseContentLength
default long getResponseContentLength()- Returns:
- The content length of the response, or
-1if it has not been set
-
isUpgrade
default boolean isUpgrade()- Returns:
- True if this exchange represents an upgrade response
-
getRequestMethod
String getRequestMethod()Get the HTTP request method- Returns:
- the HTTP request method
-
getRequestScheme
String getRequestScheme()Get the request URI scheme. Normally this is one ofhttporhttps.- Returns:
- the request URI scheme
-
getRequestURI
String getRequestURI()The original request URI. This will include the host name, getProtocol etc if it was specified by the client.This is not decoded in any way, and does not include the query string.
Examples: GET http://localhost:8080/myFile.jsf?foo=bar HTTP/1.1 -> 'http://localhost:8080/myFile.jsf' POST /my+File.jsf?foo=bar HTTP/1.1 -> '/my+File.jsf'
-
getProtocol
String getProtocol() -
isInIoThread
boolean isInIoThread() -
isHttp2
boolean isHttp2() -
addWriteFunction
-
getOutputChannel
OutputChannel getOutputChannel() -
getInputChannel
InputChannel getInputChannel() -
getInputStream
InputStream getInputStream() -
getOutputStream
OutputStream getOutputStream() -
setBlockingHttpExchange
-
getDestinationAddress
InetSocketAddress getDestinationAddress() -
getSourceAddress
InetSocketAddress getSourceAddress() -
isComplete
boolean isComplete() -
isRequestComplete
boolean isRequestComplete()Returns true if all data has been read from the request, or if there was not data.- Returns:
- true if the request is complete
-
isResponseComplete
boolean isResponseComplete()- Returns:
- true if the responses is complete
-
close
void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
getIoThread
io.netty.util.concurrent.EventExecutor getIoThread() -
setUpgradeListener
-
getWorker
Executor getWorker() -
getUndertowOptions
UndertowOptionMap getUndertowOptions() -
setUndertowOptions
-
sendContinue
void sendContinue() -
discardRequest
void discardRequest() -
isUpgradeSupported
boolean isUpgradeSupported() -
getSslSessionInfo
SSLSessionInfo getSslSessionInfo() -
isPushSupported
default boolean isPushSupported() -
isRequestTrailerFieldsSupported
default boolean isRequestTrailerFieldsSupported() -
isIoOperationQueued
boolean isIoOperationQueued() -
setMaxEntitySize
void setMaxEntitySize(long maxEntitySize) -
getMaxEntitySize
long getMaxEntitySize() -
setReadTimeout
void setReadTimeout(long readTimeoutMs) -
getReadTimeout
long getReadTimeout() -
endExchange
void endExchange() -
getResponseBytesSent
long getResponseBytesSent() -
pushResource
-