Class OAuth2WebClient

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

public class OAuth2WebClient extends WebClient implements MutinyDelegate
An asynchronous OAuth2/OIDC aware HTTP / HTTP/2 client called WebClientOAuth2.

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

  • Request an access_token if no user is created
  • Refresh access_token if current user is expired

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

See Also:
  • OAuth2WebClient
  • Field Details

  • Constructor Details

    • OAuth2WebClient

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

      public OAuth2WebClient(Object delegate)
  • Method Details

    • getDelegate

      public io.vertx.ext.web.client.OAuth2WebClient 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)

      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 OAuth2WebClient 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)
    • 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 OAuth2WebClient 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)
    • create

      public static OAuth2WebClient create(WebClient webClient, OAuth2Auth oAuth2Auth)
      Create a session aware web client using the provided webClient instance.
      Parameters:
      webClient - the web client instance
      oAuth2Auth - Configured oAuth2Auth provider to be used when withCredentials(Credentials) used
      Returns:
      the created client
    • create

      public static OAuth2WebClient create(WebClient webClient, OAuth2Auth oAuth2Auth, io.vertx.ext.web.client.OAuth2WebClientOptions options)
      Create a session aware web client using the provided webClient instance.
      Parameters:
      webClient - the web client instance
      oAuth2Auth - Configured oAuth2Auth provider to be used when withCredentials(Credentials) used
      options - extra configuration for this object
      Returns:
      the created client
    • withCredentials

      public OAuth2WebClient withCredentials(io.vertx.ext.auth.authentication.Credentials credentials)
    • getUser

      public User getUser()
      Get the authenticated user (if any) that is associated with this client.
      Returns:
      the current user associated with this client or null if no user is associated
    • newInstance

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