Package io.undertow.vertx
Class VertxHttpExchange
- java.lang.Object
-
- io.undertow.httpcore.HttpExchangeBase
-
- io.undertow.vertx.VertxHttpExchange
-
- All Implemented Interfaces:
io.undertow.httpcore.HttpExchange,io.undertow.httpcore.InputChannel,io.undertow.httpcore.OutputChannel,io.vertx.core.Handler<io.vertx.core.buffer.Buffer>,Closeable,AutoCloseable
public class VertxHttpExchange extends io.undertow.httpcore.HttpExchangeBase implements io.undertow.httpcore.HttpExchange, io.undertow.httpcore.InputChannel, io.undertow.httpcore.OutputChannel, io.vertx.core.Handler<io.vertx.core.buffer.Buffer>
-
-
Constructor Summary
Constructors Constructor Description VertxHttpExchange(io.vertx.core.http.HttpServerRequest request, io.undertow.httpcore.BufferAllocator allocator, Executor worker, Object context)VertxHttpExchange(io.vertx.core.http.HttpServerRequest request, io.undertow.httpcore.BufferAllocator allocator, Executor worker, Object context, io.vertx.core.buffer.Buffer existingBody)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRequestHeader(String name, String value)voidaddResponseHeader(String name, String value)voidclearRequestHeaders()voidclearResponseHeaders()voidclose()booleancontainsRequestHeader(String name)booleancontainsResponseHeader(String name)voiddiscardRequest()io.undertow.httpcore.BufferAllocatorgetBufferAllocator()ObjectgetContext()InetSocketAddressgetDestinationAddress()io.undertow.httpcore.InputChannelgetInputChannel()io.netty.util.concurrent.EventExecutorgetIoThread()longgetMaxEntitySize()StringgetProtocol()io.vertx.core.Handler<io.vertx.core.http.HttpServerRequest>getPushHandler()longgetReadTimeout()StringgetRequestHeader(String name)Collection<String>getRequestHeaderNames()List<String>getRequestHeaders(String name)StringgetRequestMethod()StringgetRequestScheme()StringgetRequestURI()StringgetResponseHeader(String name)Collection<String>getResponseHeaderNames()List<String>getResponseHeaders(String name)InetSocketAddressgetSourceAddress()io.undertow.httpcore.SSLSessionInfogetSslSessionInfo()intgetStatusCode()io.undertow.httpcore.UndertowOptionMapgetUndertowOptions()ExecutorgetWorker()voidhandle(io.vertx.core.buffer.Buffer event)booleanisHttp2()booleanisInIoThread()booleanisIoOperationQueued()booleanisPushSupported()booleanisReadable()booleanisUpgradeSupported()voidpushResource(String path, String method, Map<String,List<String>> requestHeaders)io.netty.buffer.ByteBufreadAsync()io.netty.buffer.ByteBufreadBlocking()intreadBytesAvailable()voidremoveRequestHeader(String name)voidremoveResponseHeader(String name)voidsendContinue()voidsetMaxEntitySize(long maxEntitySize)VertxHttpExchangesetPushHandler(io.vertx.core.Handler<io.vertx.core.http.HttpServerRequest> pushHandler)<T> voidsetReadHandler(BiConsumer<io.undertow.httpcore.InputChannel,T> handler, T context)voidsetReadTimeout(long readTimeoutMs)voidsetRequestHeader(String name, String value)voidsetResponseHeader(String name, String value)io.undertow.httpcore.HttpExchangesetStatusCode(int code)voidsetUndertowOptions(io.undertow.httpcore.UndertowOptionMap options)voidsetUpgradeListener(Consumer<Object> listener)<T> voidwriteAsync0(io.netty.buffer.ByteBuf data, boolean last, io.undertow.httpcore.IoCallback<T> callback, T context)voidwriteBlocking0(io.netty.buffer.ByteBuf data, boolean last)-
Methods inherited from class io.undertow.httpcore.HttpExchangeBase
addWriteFunction, endExchange, getInputStream, getOutputChannel, getOutputStream, getResponseBytesSent, isComplete, isRequestComplete, isRequestEntityBodyAllowed, isResponseComplete, isResponseEntityBodyAllowed, isResponseStarted, setBlockingHttpExchange, setCompletedListener, setPreCommitListener, terminateRequest, terminateResponse, writeAsync, writeAsync, writeAsync, writeAsync, writeBlocking
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface io.undertow.httpcore.HttpExchange
addWriteFunction, endExchange, getInputStream, getOutputChannel, getOutputStream, getRequestContentLength, getResponseBytesSent, getResponseContentLength, isComplete, isRequestComplete, isRequestTrailerFieldsSupported, isResponseComplete, isUpgrade, setBlockingHttpExchange, setCompletedListener, setPreCommitListener
-
-
-
-
Method Detail
-
getPushHandler
public io.vertx.core.Handler<io.vertx.core.http.HttpServerRequest> getPushHandler()
-
setPushHandler
public VertxHttpExchange setPushHandler(io.vertx.core.Handler<io.vertx.core.http.HttpServerRequest> pushHandler)
-
getBufferAllocator
public io.undertow.httpcore.BufferAllocator getBufferAllocator()
- Specified by:
getBufferAllocatorin interfaceio.undertow.httpcore.HttpExchange
-
setStatusCode
public io.undertow.httpcore.HttpExchange setStatusCode(int code)
- Specified by:
setStatusCodein interfaceio.undertow.httpcore.HttpExchange
-
getStatusCode
public int getStatusCode()
- Specified by:
getStatusCodein interfaceio.undertow.httpcore.HttpExchange
-
getRequestHeader
public String getRequestHeader(String name)
- Specified by:
getRequestHeaderin interfaceio.undertow.httpcore.HttpExchange
-
getRequestHeaders
public List<String> getRequestHeaders(String name)
- Specified by:
getRequestHeadersin interfaceio.undertow.httpcore.HttpExchange
-
containsRequestHeader
public boolean containsRequestHeader(String name)
- Specified by:
containsRequestHeaderin interfaceio.undertow.httpcore.HttpExchange
-
removeRequestHeader
public void removeRequestHeader(String name)
- Specified by:
removeRequestHeaderin interfaceio.undertow.httpcore.HttpExchange
-
setRequestHeader
public void setRequestHeader(String name, String value)
- Specified by:
setRequestHeaderin interfaceio.undertow.httpcore.HttpExchange
-
getRequestHeaderNames
public Collection<String> getRequestHeaderNames()
- Specified by:
getRequestHeaderNamesin interfaceio.undertow.httpcore.HttpExchange
-
addRequestHeader
public void addRequestHeader(String name, String value)
- Specified by:
addRequestHeaderin interfaceio.undertow.httpcore.HttpExchange
-
clearRequestHeaders
public void clearRequestHeaders()
- Specified by:
clearRequestHeadersin interfaceio.undertow.httpcore.HttpExchange
-
getResponseHeaders
public List<String> getResponseHeaders(String name)
- Specified by:
getResponseHeadersin interfaceio.undertow.httpcore.HttpExchange
-
containsResponseHeader
public boolean containsResponseHeader(String name)
- Specified by:
containsResponseHeaderin interfaceio.undertow.httpcore.HttpExchange
-
getContext
public Object getContext()
-
removeResponseHeader
public void removeResponseHeader(String name)
- Specified by:
removeResponseHeaderin interfaceio.undertow.httpcore.HttpExchange
-
setResponseHeader
public void setResponseHeader(String name, String value)
- Specified by:
setResponseHeaderin interfaceio.undertow.httpcore.HttpExchange
-
getResponseHeaderNames
public Collection<String> getResponseHeaderNames()
- Specified by:
getResponseHeaderNamesin interfaceio.undertow.httpcore.HttpExchange
-
addResponseHeader
public void addResponseHeader(String name, String value)
- Specified by:
addResponseHeaderin interfaceio.undertow.httpcore.HttpExchange
-
clearResponseHeaders
public void clearResponseHeaders()
- Specified by:
clearResponseHeadersin interfaceio.undertow.httpcore.HttpExchange
-
getResponseHeader
public String getResponseHeader(String name)
- Specified by:
getResponseHeaderin interfaceio.undertow.httpcore.HttpExchange
-
getRequestMethod
public String getRequestMethod()
- Specified by:
getRequestMethodin interfaceio.undertow.httpcore.HttpExchange
-
getRequestScheme
public String getRequestScheme()
- Specified by:
getRequestSchemein interfaceio.undertow.httpcore.HttpExchange
-
getRequestURI
public String getRequestURI()
- Specified by:
getRequestURIin interfaceio.undertow.httpcore.HttpExchange
-
getProtocol
public String getProtocol()
- Specified by:
getProtocolin interfaceio.undertow.httpcore.HttpExchange
-
isInIoThread
public boolean isInIoThread()
- Specified by:
isInIoThreadin interfaceio.undertow.httpcore.HttpExchange
-
isHttp2
public boolean isHttp2()
- Specified by:
isHttp2in interfaceio.undertow.httpcore.HttpExchange
-
getInputChannel
public io.undertow.httpcore.InputChannel getInputChannel()
- Specified by:
getInputChannelin interfaceio.undertow.httpcore.HttpExchange
-
getDestinationAddress
public InetSocketAddress getDestinationAddress()
- Specified by:
getDestinationAddressin interfaceio.undertow.httpcore.HttpExchange
-
getSourceAddress
public InetSocketAddress getSourceAddress()
- Specified by:
getSourceAddressin interfaceio.undertow.httpcore.HttpExchange
-
readAsync
public io.netty.buffer.ByteBuf readAsync() throws IOException- Specified by:
readAsyncin interfaceio.undertow.httpcore.InputChannel- Throws:
IOException
-
isReadable
public boolean isReadable()
- Specified by:
isReadablein interfaceio.undertow.httpcore.InputChannel
-
setReadHandler
public <T> void setReadHandler(BiConsumer<io.undertow.httpcore.InputChannel,T> handler, T context)
- Specified by:
setReadHandlerin interfaceio.undertow.httpcore.InputChannel
-
readBytesAvailable
public int readBytesAvailable()
- Specified by:
readBytesAvailablein interfaceio.undertow.httpcore.InputChannel
-
readBlocking
public io.netty.buffer.ByteBuf readBlocking() throws IOException- Specified by:
readBlockingin interfaceio.undertow.httpcore.InputChannel- Throws:
IOException
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceio.undertow.httpcore.HttpExchange
-
getIoThread
public io.netty.util.concurrent.EventExecutor getIoThread()
- Specified by:
getIoThreadin interfaceio.undertow.httpcore.HttpExchange
-
writeBlocking0
public void writeBlocking0(io.netty.buffer.ByteBuf data, boolean last) throws IOException- Specified by:
writeBlocking0in classio.undertow.httpcore.HttpExchangeBase- Throws:
IOException
-
writeAsync0
public <T> void writeAsync0(io.netty.buffer.ByteBuf data, boolean last, io.undertow.httpcore.IoCallback<T> callback, T context)- Specified by:
writeAsync0in classio.undertow.httpcore.HttpExchangeBase
-
handle
public void handle(io.vertx.core.buffer.Buffer event)
- Specified by:
handlein interfaceio.vertx.core.Handler<io.vertx.core.buffer.Buffer>
-
getWorker
public Executor getWorker()
- Specified by:
getWorkerin interfaceio.undertow.httpcore.HttpExchange
-
getUndertowOptions
public io.undertow.httpcore.UndertowOptionMap getUndertowOptions()
- Specified by:
getUndertowOptionsin interfaceio.undertow.httpcore.HttpExchange
-
setUndertowOptions
public void setUndertowOptions(io.undertow.httpcore.UndertowOptionMap options)
- Specified by:
setUndertowOptionsin interfaceio.undertow.httpcore.HttpExchange
-
sendContinue
public void sendContinue()
- Specified by:
sendContinuein interfaceio.undertow.httpcore.HttpExchange
-
discardRequest
public void discardRequest()
- Specified by:
discardRequestin interfaceio.undertow.httpcore.HttpExchange
-
isUpgradeSupported
public boolean isUpgradeSupported()
- Specified by:
isUpgradeSupportedin interfaceio.undertow.httpcore.HttpExchange
-
getSslSessionInfo
public io.undertow.httpcore.SSLSessionInfo getSslSessionInfo()
- Specified by:
getSslSessionInfoin interfaceio.undertow.httpcore.HttpExchange
-
isPushSupported
public boolean isPushSupported()
- Specified by:
isPushSupportedin interfaceio.undertow.httpcore.HttpExchange
-
pushResource
public void pushResource(String path, String method, Map<String,List<String>> requestHeaders)
- Specified by:
pushResourcein interfaceio.undertow.httpcore.HttpExchange
-
isIoOperationQueued
public boolean isIoOperationQueued()
- Specified by:
isIoOperationQueuedin interfaceio.undertow.httpcore.HttpExchange
-
setMaxEntitySize
public void setMaxEntitySize(long maxEntitySize)
- Specified by:
setMaxEntitySizein interfaceio.undertow.httpcore.HttpExchange
-
getMaxEntitySize
public long getMaxEntitySize()
- Specified by:
getMaxEntitySizein interfaceio.undertow.httpcore.HttpExchange
-
setReadTimeout
public void setReadTimeout(long readTimeoutMs)
- Specified by:
setReadTimeoutin interfaceio.undertow.httpcore.HttpExchange
-
getReadTimeout
public long getReadTimeout()
- Specified by:
getReadTimeoutin interfaceio.undertow.httpcore.HttpExchange
-
-