Class ProxyResponse

java.lang.Object
io.vertx.mutiny.httpproxy.ProxyResponse
All Implemented Interfaces:
MutinyDelegate

public class ProxyResponse extends Object implements MutinyDelegate
Handles the interoperability of the response between the origin and the user agent.

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

Author:
Julien Viet
See Also:
  • ProxyResponse
  • Field Details

  • Constructor Details

    • ProxyResponse

      public ProxyResponse(io.vertx.httpproxy.ProxyResponse delegate)
      Create a new instance of ProxyResponse delegating to the given (non-null) instance of ProxyResponse.
    • ProxyResponse

      public ProxyResponse(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.httpproxy.ProxyResponse getDelegate()
      Get the delegate instance.

      This method returns the instance on which this shim is delegating the calls. And so, give you access to the bare API.

      Specified by:
      getDelegate in interface MutinyDelegate
      Returns:
      the delegate instance
    • send

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> send()
      Send the proxies response to the user agent.

      Unlike the bare Vert.x variant, this method returns a Uni. The uni emits the result of the operation as item. If the operation fails, the uni emits the failure.

      Don't forget to subscribe on it to trigger the operation.

      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • ProxyResponse.send()
    • sendAndAwait

      public void sendAndAwait()
      Send the proxies response to the user agent.

      Unlike the bare Vert.x variant, this method returns a Void. This method awaits indefinitely 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).

      See Also:
      • ProxyResponse.send()
    • sendAndForget

      public ProxyResponse sendAndForget()
      Send the proxies response to the user agent.

      Unlike the bare Vert.x variant, this method ignores the Void result or any failure.

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • ProxyResponse.send()
    • request

      public ProxyRequest request()
      Return the corresponding ProxyRequest.
      Returns:
      the proxy request
    • getStatusCode

      public int getStatusCode()
      Get the status code.
      Returns:
      the status code to be sent to the user agent
    • setStatusCode

      public ProxyResponse setStatusCode(int sc)
      Set the status code to be sent to the user agent.

      The initial value is the proxied response status code.

      Parameters:
      sc - the status code
      Returns:
      a reference to this, so the API can be used fluently
    • getStatusMessage

      public String getStatusMessage()
      Get the status message.
      Returns:
      the status message to be sent to the user agent
    • setStatusMessage

      public ProxyResponse setStatusMessage(String statusMessage)
      Set the status message to be sent to the user agent.

      The initial value is the proxied response status message.

      Parameters:
      statusMessage - the status message
      Returns:
      a reference to this, so the API can be used fluently
    • headers

      public io.vertx.core.MultiMap headers()
      Returns:
      the headers that will be sent to the user agent, the returned headers can be modified. The headers map is populated with the proxied response headers
    • getBody

      public Body getBody()
      Get the body of the response.
      Returns:
      the response body to be sent to the user agent
    • setBody

      public ProxyResponse setBody(Body body)
      Set the request body to be sent to the user agent.

      The initial request body value is the proxied response body.

      Parameters:
      body - the new body
      Returns:
      a reference to this, so the API can be used fluently
    • proxiedResponse

      public HttpClientResponse proxiedResponse()
      Returns:
      the proxied HTTP server response
    • publicCacheControl

      public boolean publicCacheControl()
    • maxAge

      public long maxAge()
    • etag

      public String etag()
      Returns:
      the etag sent by the origin response
    • release

      public ProxyResponse release()
      Release the proxy response.

      The proxied response is resumed, no HTTP response is sent to the user-agent

    • newInstance

      public static ProxyResponse newInstance(io.vertx.httpproxy.ProxyResponse delegate)
      Creates a new instance of the ProxyResponse.
    • hashCode

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object