com.holonplatform.reactor.spring.internal

## Class WebClientReactiveRestClient

- java.lang.Object
- - com.holonplatform.reactor.http.internal.AbstractReactiveRestClient
  - - com.holonplatform.reactor.spring.internal.WebClientReactiveRestClient

- All Implemented Interfaces:
    com.holonplatform.http.rest.RestClientOperations<ReactiveRestClient,ReactiveRestClient.ReactiveRequestDefinition>, ReactiveInvoker, ReactiveRestClient, SpringReactiveRestClient

      public class WebClientReactiveRestClient
      extends AbstractReactiveRestClient
      implements SpringReactiveRestClient

  Default `SpringReactiveRestClient` implementation.
  Since:
    5.2.0

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface com.holonplatform.reactor.http.ReactiveRestClient

      `ReactiveRestClient.ReactiveInvocation, ReactiveRestClient.ReactiveRequestDefinition`

    - ### Nested classes/interfaces inherited from interface com.holonplatform.http.rest.RestClientOperations

      `com.holonplatform.http.rest.RestClientOperations.InvocationOperations<RE,RP,RS,RL,RU>, com.holonplatform.http.rest.RestClientOperations.RequestConfiguration<R extends com.holonplatform.http.rest.RestClientOperations.RequestConfiguration<R>>`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `WebClientReactiveRestClient(org.springframework.web.reactive.function.client.WebClient client)` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.springframework.web.reactive.function.client.WebClient` | `getClient()` Get the `WebClient` bound to this RestClient.
    `<T,R> reactor.core.publisher.Mono<ReactiveResponseEntity<T>>` | `invoke(ReactiveRestClient.ReactiveRequestDefinition requestDefinition, com.holonplatform.http.HttpMethod method, com.holonplatform.http.rest.RequestEntity<R> requestEntity, com.holonplatform.http.rest.ResponseType<T> responseType, boolean onlySuccessfulStatusCode)` Invoke a request asynchronously using current given `request` definition.

    - ### Methods inherited from class com.holonplatform.reactor.http.internal.AbstractReactiveRestClient

      `clearDefaultHeaders, defaultTarget, getDefaultTarget, removeDefaultHeader, request, withDefaultHeader`

    - ### Methods inherited from class java.lang.Object

      `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.holonplatform.reactor.spring.SpringReactiveRestClient

      `create`

    - ### Methods inherited from interface com.holonplatform.reactor.http.ReactiveRestClient

      `create, create, create, create, forTarget, forTarget`

    - ### Methods inherited from interface com.holonplatform.http.rest.RestClientOperations

      `clearDefaultHeaders, defaultTarget, getDefaultTarget, removeDefaultHeader, request, withDefaultHeader`

- - ### Constructor Detail

    - #### WebClientReactiveRestClient

          public WebClientReactiveRestClient(org.springframework.web.reactive.function.client.WebClient client)

      Constructor
      Parameters:
        `client` - Spring `WebClient`

  - ### Method Detail

    - #### getClient

          public org.springframework.web.reactive.function.client.WebClient getClient()

      Description copied from interface: `SpringReactiveRestClient`
      Get the `WebClient` bound to this RestClient.
      Specified by:
        `getClient` in interface `SpringReactiveRestClient`
      Returns:
        The `WebClient` reference

    - #### invoke

          public <T,R> reactor.core.publisher.Mono<ReactiveResponseEntity<T>> invoke(ReactiveRestClient.ReactiveRequestDefinition requestDefinition,
                                                                                     com.holonplatform.http.HttpMethod method,
                                                                                     com.holonplatform.http.rest.RequestEntity<R> requestEntity,
                                                                                     com.holonplatform.http.rest.ResponseType<T> responseType,
                                                                                     boolean onlySuccessfulStatusCode)

      Description copied from interface: `ReactiveInvoker`
      Invoke a request asynchronously using current given `request` definition.
      Specified by:
        `invoke` in interface `ReactiveInvoker`
      Type Parameters:
        `T` - Response type
        `R` - Request entity type
      Parameters:
        `requestDefinition` - Request definition
        `method` - Request method
        `requestEntity` - Request message payload
        `responseType` - Expected response payload type
        `onlySuccessfulStatusCode` - `true` to return only `2xx` status code response and throw an `UnsuccessfulResponseException` otherwise, `false` to return any status code responses
      Returns:
        A `Mono` to handle the `ReactiveResponseEntity` object as the result of the request invocation

Copyright © 2019 The Holon Platform. All rights reserved.