Class ProxyContext

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

public class ProxyContext extends Object implements MutinyDelegate
A controller for proxy interception.

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

See Also:
  • ProxyContext
  • Field Details

  • Constructor Details

    • ProxyContext

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

      public ProxyContext(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.httpproxy.ProxyContext 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
    • sendRequest

      @CheckReturnValue public io.smallrye.mutiny.Uni<ProxyResponse> sendRequest()

      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:
      • ProxyContext.sendRequest()
    • sendRequestAndAwait

      public ProxyResponse sendRequestAndAwait()

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

      Returns:
      The operation result
      See Also:
      • ProxyContext.sendRequest()
    • sendRequestAndForget

      public ProxyContext sendRequestAndForget()

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

      Returns:
      The current instance to chain operations if needed.
      See Also:
      • ProxyContext.sendRequest()
    • sendResponse

      @CheckReturnValue public io.smallrye.mutiny.Uni<Void> sendResponse()

      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:
      • ProxyContext.sendResponse()
    • sendResponseAndAwait

      public void sendResponseAndAwait()

      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:
      • ProxyContext.sendResponse()
    • sendResponseAndForget

      public ProxyContext sendResponseAndForget()

      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:
      • ProxyContext.sendResponse()
    • request

      public ProxyRequest request()
      Returns:
      the proxy request
    • response

      public ProxyResponse response()
      Returns:
      the proxy response, it might be null if the response has not been sent
    • isWebSocket

      public boolean isWebSocket()
      Returns:
      if this request or response is the handshake of WebSocket
    • set

      public void set(String name, Object value)
      Attach a payload to the context.
      Parameters:
      name - the payload name
      value - any payload value
    • get

      public <T> T get(String name, Class<T> type)
      Get a payload attached to this context.
      Parameters:
      name - the payload name
      type - the expected payload type
      Returns:
      the attached payload
    • client

      public HttpClient client()
      Returns:
      the HttpClient use to interact with the origin server
    • newInstance

      public static ProxyContext newInstance(io.vertx.httpproxy.ProxyContext delegate)
      Creates a new instance of the ProxyContext.
    • 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