com.holonplatform.reactor.http.internal

## Class DefaultReactiveRequestDefinition

- java.lang.Object
- - com.holonplatform.http.internal.rest.AbstractRequestDefinition<ReactiveRestClient.ReactiveRequestDefinition>
  - - com.holonplatform.reactor.http.internal.DefaultReactiveRequestDefinition

- All Implemented Interfaces:
    com.holonplatform.http.rest.RestClientOperations.InvocationOperations<reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<InputStream>,reactor.core.publisher.Flux<?>,reactor.core.publisher.Mono<URI>>, com.holonplatform.http.rest.RestClientOperations.RequestConfiguration<ReactiveRestClient.ReactiveRequestDefinition>, ReactiveRestClient.ReactiveInvocation, ReactiveRestClient.ReactiveRequestDefinition

      public class DefaultReactiveRequestDefinition
      extends com.holonplatform.http.internal.rest.AbstractRequestDefinition<ReactiveRestClient.ReactiveRequestDefinition>
      implements ReactiveRestClient.ReactiveRequestDefinition

  Default `ReactiveRestClient.ReactiveRequestDefinition` implementation.
  Since:
    5.2.0

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DefaultReactiveRequestDefinition(ReactiveInvoker invoker)` Constructor.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `<T,R> reactor.core.publisher.Mono<ReactiveResponseEntity<T>>` | `invoke(com.holonplatform.http.HttpMethod method, com.holonplatform.http.rest.RequestEntity<R> requestEntity, com.holonplatform.http.rest.ResponseType<T> responseType)` Invoke the request and asynchronously receive a response back.
    `<T,R> reactor.core.publisher.Mono<T>` | `invokeForEntity(com.holonplatform.http.HttpMethod method, com.holonplatform.http.rest.RequestEntity<R> requestEntity, com.holonplatform.http.rest.ResponseType<T> responseType)` Invoke the request and asynchronously receive back the response content entity.
    `<T,R> reactor.core.publisher.Flux<T>` | `invokeForFlux(com.holonplatform.http.HttpMethod method, com.holonplatform.http.rest.RequestEntity<R> requestEntity, Class<T> responseElementType)` Invoke the request and asynchronously receive back the response as a `Flux` of response entity elements.
    `<R> reactor.core.publisher.Mono<InputStream>` | `invokeForStream(com.holonplatform.http.HttpMethod method, com.holonplatform.http.rest.RequestEntity<R> requestEntity)` Invoke the request and asynchronously receive back the response as a raw `InputStream`.
    `<T,R> reactor.core.publisher.Mono<ReactiveResponseEntity<T>>` | `invokeForSuccess(com.holonplatform.http.HttpMethod method, com.holonplatform.http.rest.RequestEntity<R> requestEntity, com.holonplatform.http.rest.ResponseType<T> responseType)` Invoke the request and asynchronously receive a response back only if the response has a success (`2xx`) status code.

    - ### Methods inherited from class com.holonplatform.http.internal.rest.AbstractRequestDefinition

      `accept, accept, acceptCharset, acceptCharset, acceptEncoding, acceptLanguage, acceptLanguage, authorizationBasic, authorizationBearer, cacheControl, getBaseRequestURI, getHeaders, getPropertySet, getQueryParameters, getRequestPath, getRequestURI, getTemplateParameters, header, path, propertySet, propertySet, queryParameter, resolve, resolve, target, toString`

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

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

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

      `accept, accept, acceptCharset, acceptCharset, acceptEncoding, acceptLanguage, acceptLanguage, authorizationBasic, authorizationBearer, cacheControl, getBaseRequestURI, getHeaders, getPropertySet, getQueryParameters, getRequestPath, getRequestURI, getTemplateParameters, header, path, propertySet, propertySet, queryParameter, resolve, resolve, target, target`

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

      `delete, delete, delete, deleteForEntity, deleteForEntity, deleteOrFail, get, get, getAsList, getForEntity, getForEntity, getForStream, head, options, options, options, optionsForEntity, optionsForEntity, patch, patch, patch, patchForEntity, patchForEntity, post, post, post, postForEntity, postForEntity, postForLocation, put, put, put, putForEntity, putForEntity, trace, trace, trace, traceForEntity, traceForEntity`

- - ### Constructor Detail

    - #### DefaultReactiveRequestDefinition

          public DefaultReactiveRequestDefinition(ReactiveInvoker invoker)

      Constructor.
      Parameters:
        `invoker` - Invoker to use to invoke for response

  - ### Method Detail

    - #### invoke

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

      Description copied from interface: `ReactiveRestClient.ReactiveInvocation`
      Invoke the request and asynchronously receive a response back.

      The response payload is processed and possibly converted by concrete client implementation.

      Specified by:
        `invoke` in interface `com.holonplatform.http.rest.RestClientOperations.InvocationOperations<reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<InputStream>,reactor.core.publisher.Flux<?>,reactor.core.publisher.Mono<URI>>`
      Specified by:
        `invoke` in interface `ReactiveRestClient.ReactiveInvocation`
      Type Parameters:
        `T` - Response type
        `R` - Request entity type
      Parameters:
        `method` - Request method
        `requestEntity` - Request entity
        `responseType` - Expected response payload type
      Returns:
        A `Mono` to handle the `ReactiveResponseEntity` object as the result of the request invocation

    - #### invokeForSuccess

          public <T,R> reactor.core.publisher.Mono<ReactiveResponseEntity<T>> invokeForSuccess(com.holonplatform.http.HttpMethod method,
                                                                                               com.holonplatform.http.rest.RequestEntity<R> requestEntity,
                                                                                               com.holonplatform.http.rest.ResponseType<T> responseType)

      Description copied from interface: `ReactiveRestClient.ReactiveInvocation`
      Invoke the request and asynchronously receive a response back only if the response has a success (`2xx`) status code.
      Specified by:
        `invokeForSuccess` in interface `com.holonplatform.http.rest.RestClientOperations.InvocationOperations<reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<InputStream>,reactor.core.publisher.Flux<?>,reactor.core.publisher.Mono<URI>>`
      Specified by:
        `invokeForSuccess` in interface `ReactiveRestClient.ReactiveInvocation`
      Type Parameters:
        `T` - Response type
        `R` - Request entity type
      Parameters:
        `method` - Request method
        `requestEntity` - Request entity
        `responseType` - Expected response payload type
      Returns:
        A `Mono` to handle the `ReactiveResponseEntity` object as a result of the request invocation

    - #### invokeForEntity

          public <T,R> reactor.core.publisher.Mono<T> invokeForEntity(com.holonplatform.http.HttpMethod method,
                                                                      com.holonplatform.http.rest.RequestEntity<R> requestEntity,
                                                                      com.holonplatform.http.rest.ResponseType<T> responseType)

      Description copied from interface: `ReactiveRestClient.ReactiveInvocation`
      Invoke the request and asynchronously receive back the response content entity.
      Specified by:
        `invokeForEntity` in interface `com.holonplatform.http.rest.RestClientOperations.InvocationOperations<reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<?>,reactor.core.publisher.Mono<InputStream>,reactor.core.publisher.Flux<?>,reactor.core.publisher.Mono<URI>>`
      Specified by:
        `invokeForEntity` in interface `ReactiveRestClient.ReactiveInvocation`
      Type Parameters:
        `T` - Response type
        `R` - Request entity type
      Parameters:
        `method` - Request method
        `requestEntity` - Request entity
        `responseType` - Expected response payload type
      Returns:
        A `Mono` to handle the response payload of expected type as the result of the request invocation, or an empty Optional if not present (empty response entity)

    - #### invokeForStream

          public <R> reactor.core.publisher.Mono<InputStream> invokeForStream(com.holonplatform.http.HttpMethod method,
                                                                              com.holonplatform.http.rest.RequestEntity<R> requestEntity)

      Description copied from interface: `ReactiveRestClient.ReactiveInvocation`
      Invoke the request and asynchronously receive back the response as a raw `InputStream`.
      Specified by:
        `invokeForStream` in interface `ReactiveRestClient.ReactiveInvocation`
      Type Parameters:
        `R` - Request entity type
      Parameters:
        `method` - Request method
        `requestEntity` - Request entity
      Returns:
        A `Mono` to handle the response payload stream * @throws HttpClientInvocationException Internal invocation failure (for example, an I/O error on communication channel or expected and actual payload type mismatch)

    - #### invokeForFlux

          public <T,R> reactor.core.publisher.Flux<T> invokeForFlux(com.holonplatform.http.HttpMethod method,
                                                                    com.holonplatform.http.rest.RequestEntity<R> requestEntity,
                                                                    Class<T> responseElementType)

      Description copied from interface: `ReactiveRestClient.ReactiveInvocation`
      Invoke the request and asynchronously receive back the response as a `Flux` of response entity elements.
      Specified by:
        `invokeForFlux` in interface `ReactiveRestClient.ReactiveInvocation`
      Type Parameters:
        `T` - Response type
        `R` - Request entity type
      Parameters:
        `method` - Request method
        `requestEntity` - Request entity
        `responseElementType` - Expected response entity elements type
      Returns:
        A `Flux` to handle the response payload elements

Copyright © 2019 The Holon Platform. All rights reserved.