Class WebClientSession

java.lang.Object
io.vertx.mutiny.ext.web.client.WebClient
io.vertx.mutiny.ext.web.client.WebClientSession
All Implemented Interfaces:
MutinyDelegate

public class WebClientSession extends WebClient implements MutinyDelegate
An asynchronous sessions aware HTTP / HTTP/2 client called WebClientSession.

This client wraps a WebClient and makes it session aware adding features to it:

  • Per client headers, to be send with every request
  • Per client cookies, to be send with every request
  • Automatic storage and sending of cookies received from the server(s)

The client honors the cookies attributes:

  • domain
  • path
  • secure
  • max-age and expires

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

Author:
Tommaso Nolli
See Also:
  • WebClientSession
  • Field Details

  • Constructor Details

    • WebClientSession

      public WebClientSession(io.vertx.ext.web.client.WebClientSession delegate)
      Create a new instance of WebClientSession delegating to the given (non-null) instance of WebClientSession.
    • WebClientSession

      public WebClientSession(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.client.WebClientSession 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
      Overrides:
      getDelegate in class WebClient
      Returns:
      the delegate instance
    • updateSSLOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The options object is compared using its equals method against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, setting force to true forces the update.

      The boolean succeeded uni result indicates whether the update occurred.

      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.

      Overrides:
      updateSSLOptions in class WebClient
      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions, boolean)
    • updateSSLOptionsAndAwait

      public Boolean updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The options object is compared using its equals method against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, setting force to true forces the update.

      The boolean succeeded underlying uni result indicates whether the update occurred.

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

      Overrides:
      updateSSLOptionsAndAwait in class WebClient
      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      The operation result
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions, boolean)
    • updateSSLOptionsAndForget

      public WebClientSession updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions arg0, boolean arg1)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The options object is compared using its equals method against the existing options to prevent an update when the objects are equals since loading options can be costly, this can happen for share TCP servers. When object are equals, setting force to true forces the update.

      The boolean succeeded underlying uni result indicates whether the update occurred.

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

      Overrides:
      updateSSLOptionsAndForget in class WebClient
      Parameters:
      options - the new SSL options
      force - force the update when options are equals
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions, boolean)
    • updateSSLOptions

      @CheckReturnValue public io.smallrye.mutiny.Uni<Boolean> updateSSLOptions(io.vertx.core.net.ClientSSLOptions arg0)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The boolean succeeded uni result indicates whether the update occurred.

      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.

      Overrides:
      updateSSLOptions in class WebClient
      Parameters:
      options - the new SSL options
      Returns:
      A Uni representing the asynchronous result of this operation.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions)
    • updateSSLOptionsAndAwait

      public Boolean updateSSLOptionsAndAwait(io.vertx.core.net.ClientSSLOptions arg0)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The boolean succeeded underlying uni result indicates whether the update occurred.

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

      Overrides:
      updateSSLOptionsAndAwait in class WebClient
      Parameters:
      options - the new SSL options
      Returns:
      The operation result
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions)
    • updateSSLOptionsAndForget

      public WebClientSession updateSSLOptionsAndForget(io.vertx.core.net.ClientSSLOptions arg0)

      Update the client with new SSL options, the update happens if the options object is valid and different from the existing options object.

      The boolean succeeded underlying uni result indicates whether the update occurred.

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

      Overrides:
      updateSSLOptionsAndForget in class WebClient
      Parameters:
      options - the new SSL options
      Returns:
      The current instance to chain operations if needed.
      See Also:
      • WebClient.updateSSLOptions(ClientSSLOptions)
    • create

      public static WebClientSession create(WebClient webClient)
      Create a session aware web client using the provided webClient instance.
      Parameters:
      webClient - the web client instance
      Returns:
      the created client
    • create

      public static WebClientSession create(WebClient webClient, io.vertx.ext.web.client.spi.CookieStore cookieStore)
      Create a session aware web client using the provided webClient instance.
      Parameters:
      webClient - the web client instance
      Returns:
      the created client
    • addHeader

      public WebClientSession addHeader(CharSequence name, CharSequence value)
      Configure the client to add an HTTP header to every request.
      Parameters:
      name - the header name
      value - the header value
      Returns:
      a reference to this, so the API can be used fluently
    • addHeader

      public WebClientSession addHeader(String name, String value)
      Configure the client to add an HTTP header to every request.
      Parameters:
      name - the header name
      value - the header value
      Returns:
      a reference to this, so the API can be used fluently
    • addHeader

      public WebClientSession addHeader(CharSequence name, Iterable<CharSequence> values)
      Configure the client to add an HTTP header to every request.
      Parameters:
      name - the header name
      values - the header value
      Returns:
      a reference to this, so the API can be used fluently
    • addHeader

      public WebClientSession addHeader(String name, Iterable<String> values)
      Configure the client to add an HTTP header to every request.
      Parameters:
      name - the header name
      values - the header value
      Returns:
      a reference to this, so the API can be used fluently
    • removeHeader

      public WebClientSession removeHeader(CharSequence name)
      Removes a previously added header.
      Parameters:
      name - the header name
      Returns:
      a reference to this, so the API can be used fluently
    • removeHeader

      public WebClientSession removeHeader(String name)
      Removes a previously added header.
      Parameters:
      name - the header name
      Returns:
      a reference to this, so the API can be used fluently
    • cookieStore

      public io.vertx.ext.web.client.spi.CookieStore cookieStore()
      Returns this client's CookieStore

      All cookies added to this store will be sent with every request. The CookieStore honors the domain, path, secure and max-age properties of received cookies and is automatically updated with cookies present in responses received by this client.

      Returns:
      this client's cookie store
    • newInstance

      public static WebClientSession newInstance(io.vertx.ext.web.client.WebClientSession delegate)
      Creates a new instance of the WebClientSession.
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class WebClient