Class ProxyRequest


  • public class ProxyRequest
    extends Object
    Handles the interoperability of the request between the user agent and the origin.

    NOTE: This class has been automatically generated from the original non Mutiny-ified interface using Vert.x codegen.

    • Constructor Detail

      • ProxyRequest

        public ProxyRequest​(io.vertx.httpproxy.ProxyRequest delegate)
      • ProxyRequest

        public ProxyRequest​(Object delegate)
    • Method Detail

      • getDelegate

        public io.vertx.httpproxy.ProxyRequest getDelegate()
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • reverseProxy

        public static ProxyRequest reverseProxy​(HttpServerRequest proxiedRequest)
        Parameters:
        proxiedRequest - the HttpServerRequest that is proxied
        Returns:
        a reference to this, so the API can be used fluently
      • version

        public io.vertx.core.http.HttpVersion version()
        Returns:
        the HTTP version of the proxied request
      • absoluteURI

        public String absoluteURI()
        Returns:
        the absolute URI of the proxied request
      • getMethod

        public io.vertx.core.http.HttpMethod getMethod()
        Returns:
        the HTTP method to be sent to the origin server.
      • setMethod

        public ProxyRequest setMethod​(io.vertx.core.http.HttpMethod method)
        Parameters:
        method - the new HTTP method
        Returns:
        a reference to this, so the API can be used fluently
      • getURI

        public String getURI()
        Returns:
        the request URI to be sent to the origin server.
      • setURI

        public ProxyRequest setURI​(String uri)
        Parameters:
        uri - the new URI
        Returns:
        a reference to this, so the API can be used fluently
      • getBody

        public Body getBody()
        Returns:
        the request body to be sent to the origin server.
      • setBody

        public ProxyRequest setBody​(Body body)
        Parameters:
        body - the new body
        Returns:
        a reference to this, so the API can be used fluently
      • setAuthority

        public ProxyRequest setAuthority​(HostAndPort authority)
        Parameters:
        authority - the authority
        Returns:
        a reference to this, so the API can be used fluently
      • getAuthority

        public HostAndPort getAuthority()
        Returns:
        the request authority, for HTTP2 the pseudo header otherwise the header
      • headers

        public MultiMap headers()
        Returns:
        the headers that will be sent to the origin server, the returned headers can be modified. The headers map is populated with the proxied request headers
      • proxy

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<Void> proxy​(HttpClientRequest request)
        Proxy this request to the origin server using the specified request and then send the proxy response.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        request - the request connected to the origin server
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • proxyAndAwait

        public Void proxyAndAwait​(HttpClientRequest request)
        Blocking variant of proxy(io.vertx.mutiny.core.http.HttpClientRequest).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        request - the request connected to the origin server
        Returns:
        the Void instance produced by the operation.
      • send

        @CheckReturnValue
        public io.smallrye.mutiny.Uni<ProxyResponse> send​(HttpClientRequest request)
        Send this request to the origin server using the specified request.

        The returned future will be completed with the proxy response returned by the origin.

        Unlike the bare Vert.x variant, this method returns a Uni. Don't forget to subscribe on it to trigger the operation.

        Parameters:
        request - the request connected to the origin server
        Returns:
        the uni firing the result of the operation when completed, or a failure if the operation failed.
      • sendAndAwait

        public ProxyResponse sendAndAwait​(HttpClientRequest request)
        Blocking variant of send(io.vertx.mutiny.core.http.HttpClientRequest).

        This method waits for the completion of the underlying asynchronous operation. If the operation completes successfully, the result is returned, otherwise the failure is thrown (potentially wrapped in a RuntimeException).

        Parameters:
        request - the request connected to the origin server
        Returns:
        the ProxyResponse instance produced by the operation.
      • release

        public ProxyRequest release()
        Returns:
        a reference to this, so the API can be used fluently
      • proxiedRequest

        public HttpServerRequest proxiedRequest()
        Returns:
        the proxied HTTP server request
      • response

        public ProxyResponse response()
        Returns:
        the proxy response
      • newInstance

        public static ProxyRequest newInstance​(io.vertx.httpproxy.ProxyRequest arg)