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 Details

    • VertxHttpExchange

      public VertxHttpExchange(io.vertx.core.http.HttpServerRequest request, io.undertow.httpcore.BufferAllocator allocator, Executor worker, Object context)
    • VertxHttpExchange

      public VertxHttpExchange(io.vertx.core.http.HttpServerRequest request, io.undertow.httpcore.BufferAllocator allocator, Executor worker, Object context, io.vertx.core.buffer.Buffer existingBody)
  • Method Details

    • 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:
      getBufferAllocator in interface io.undertow.httpcore.HttpExchange
    • setStatusCode

      public io.undertow.httpcore.HttpExchange setStatusCode(int code)
      Specified by:
      setStatusCode in interface io.undertow.httpcore.HttpExchange
    • getStatusCode

      public int getStatusCode()
      Specified by:
      getStatusCode in interface io.undertow.httpcore.HttpExchange
    • getRequestHeader

      public String getRequestHeader(String name)
      Specified by:
      getRequestHeader in interface io.undertow.httpcore.HttpExchange
    • getRequestHeaders

      public List<String> getRequestHeaders(String name)
      Specified by:
      getRequestHeaders in interface io.undertow.httpcore.HttpExchange
    • containsRequestHeader

      public boolean containsRequestHeader(String name)
      Specified by:
      containsRequestHeader in interface io.undertow.httpcore.HttpExchange
    • removeRequestHeader

      public void removeRequestHeader(String name)
      Specified by:
      removeRequestHeader in interface io.undertow.httpcore.HttpExchange
    • setRequestHeader

      public void setRequestHeader(String name, String value)
      Specified by:
      setRequestHeader in interface io.undertow.httpcore.HttpExchange
    • getRequestHeaderNames

      public Collection<String> getRequestHeaderNames()
      Specified by:
      getRequestHeaderNames in interface io.undertow.httpcore.HttpExchange
    • addRequestHeader

      public void addRequestHeader(String name, String value)
      Specified by:
      addRequestHeader in interface io.undertow.httpcore.HttpExchange
    • clearRequestHeaders

      public void clearRequestHeaders()
      Specified by:
      clearRequestHeaders in interface io.undertow.httpcore.HttpExchange
    • getResponseHeaders

      public List<String> getResponseHeaders(String name)
      Specified by:
      getResponseHeaders in interface io.undertow.httpcore.HttpExchange
    • containsResponseHeader

      public boolean containsResponseHeader(String name)
      Specified by:
      containsResponseHeader in interface io.undertow.httpcore.HttpExchange
    • getContext

      public Object getContext()
    • removeResponseHeader

      public void removeResponseHeader(String name)
      Specified by:
      removeResponseHeader in interface io.undertow.httpcore.HttpExchange
    • setResponseHeader

      public void setResponseHeader(String name, String value)
      Specified by:
      setResponseHeader in interface io.undertow.httpcore.HttpExchange
    • getResponseHeaderNames

      public Collection<String> getResponseHeaderNames()
      Specified by:
      getResponseHeaderNames in interface io.undertow.httpcore.HttpExchange
    • addResponseHeader

      public void addResponseHeader(String name, String value)
      Specified by:
      addResponseHeader in interface io.undertow.httpcore.HttpExchange
    • clearResponseHeaders

      public void clearResponseHeaders()
      Specified by:
      clearResponseHeaders in interface io.undertow.httpcore.HttpExchange
    • getResponseHeader

      public String getResponseHeader(String name)
      Specified by:
      getResponseHeader in interface io.undertow.httpcore.HttpExchange
    • getRequestMethod

      public String getRequestMethod()
      Specified by:
      getRequestMethod in interface io.undertow.httpcore.HttpExchange
    • getRequestScheme

      public String getRequestScheme()
      Specified by:
      getRequestScheme in interface io.undertow.httpcore.HttpExchange
    • getRequestURI

      public String getRequestURI()
      Specified by:
      getRequestURI in interface io.undertow.httpcore.HttpExchange
    • getProtocol

      public String getProtocol()
      Specified by:
      getProtocol in interface io.undertow.httpcore.HttpExchange
    • isInIoThread

      public boolean isInIoThread()
      Specified by:
      isInIoThread in interface io.undertow.httpcore.HttpExchange
    • isHttp2

      public boolean isHttp2()
      Specified by:
      isHttp2 in interface io.undertow.httpcore.HttpExchange
    • getInputChannel

      public io.undertow.httpcore.InputChannel getInputChannel()
      Specified by:
      getInputChannel in interface io.undertow.httpcore.HttpExchange
    • getDestinationAddress

      public InetSocketAddress getDestinationAddress()
      Specified by:
      getDestinationAddress in interface io.undertow.httpcore.HttpExchange
    • getSourceAddress

      public InetSocketAddress getSourceAddress()
      Specified by:
      getSourceAddress in interface io.undertow.httpcore.HttpExchange
    • readAsync

      public io.netty.buffer.ByteBuf readAsync() throws IOException
      Specified by:
      readAsync in interface io.undertow.httpcore.InputChannel
      Throws:
      IOException
    • isReadable

      public boolean isReadable()
      Specified by:
      isReadable in interface io.undertow.httpcore.InputChannel
    • setReadHandler

      public <T> void setReadHandler(BiConsumer<io.undertow.httpcore.InputChannel,T> handler, T context)
      Specified by:
      setReadHandler in interface io.undertow.httpcore.InputChannel
    • readBytesAvailable

      public int readBytesAvailable()
      Specified by:
      readBytesAvailable in interface io.undertow.httpcore.InputChannel
    • readBlocking

      public io.netty.buffer.ByteBuf readBlocking() throws IOException
      Specified by:
      readBlocking in interface io.undertow.httpcore.InputChannel
      Throws:
      IOException
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
      Specified by:
      close in interface io.undertow.httpcore.HttpExchange
    • getIoThread

      public io.netty.util.concurrent.EventExecutor getIoThread()
      Specified by:
      getIoThread in interface io.undertow.httpcore.HttpExchange
    • writeBlocking0

      public void writeBlocking0(io.netty.buffer.ByteBuf data, boolean last) throws IOException
      Specified by:
      writeBlocking0 in class io.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:
      writeAsync0 in class io.undertow.httpcore.HttpExchangeBase
    • handle

      public void handle(io.vertx.core.buffer.Buffer event)
      Specified by:
      handle in interface io.vertx.core.Handler<io.vertx.core.buffer.Buffer>
    • getWorker

      public Executor getWorker()
      Specified by:
      getWorker in interface io.undertow.httpcore.HttpExchange
    • getUndertowOptions

      public io.undertow.httpcore.UndertowOptionMap getUndertowOptions()
      Specified by:
      getUndertowOptions in interface io.undertow.httpcore.HttpExchange
    • setUndertowOptions

      public void setUndertowOptions(io.undertow.httpcore.UndertowOptionMap options)
      Specified by:
      setUndertowOptions in interface io.undertow.httpcore.HttpExchange
    • sendContinue

      public void sendContinue()
      Specified by:
      sendContinue in interface io.undertow.httpcore.HttpExchange
    • discardRequest

      public void discardRequest()
      Specified by:
      discardRequest in interface io.undertow.httpcore.HttpExchange
    • isUpgradeSupported

      public boolean isUpgradeSupported()
      Specified by:
      isUpgradeSupported in interface io.undertow.httpcore.HttpExchange
    • getSslSessionInfo

      public io.undertow.httpcore.SSLSessionInfo getSslSessionInfo()
      Specified by:
      getSslSessionInfo in interface io.undertow.httpcore.HttpExchange
    • isPushSupported

      public boolean isPushSupported()
      Specified by:
      isPushSupported in interface io.undertow.httpcore.HttpExchange
    • pushResource

      public void pushResource(String path, String method, Map<String,List<String>> requestHeaders)
      Specified by:
      pushResource in interface io.undertow.httpcore.HttpExchange
    • isIoOperationQueued

      public boolean isIoOperationQueued()
      Specified by:
      isIoOperationQueued in interface io.undertow.httpcore.HttpExchange
    • setMaxEntitySize

      public void setMaxEntitySize(long maxEntitySize)
      Specified by:
      setMaxEntitySize in interface io.undertow.httpcore.HttpExchange
    • getMaxEntitySize

      public long getMaxEntitySize()
      Specified by:
      getMaxEntitySize in interface io.undertow.httpcore.HttpExchange
    • setReadTimeout

      public void setReadTimeout(long readTimeoutMs)
      Specified by:
      setReadTimeout in interface io.undertow.httpcore.HttpExchange
    • getReadTimeout

      public long getReadTimeout()
      Specified by:
      getReadTimeout in interface io.undertow.httpcore.HttpExchange
    • setUpgradeListener

      public void setUpgradeListener(Consumer<Object> listener)
      Specified by:
      setUpgradeListener in interface io.undertow.httpcore.HttpExchange