org.springframework.cloud.dataflow.rest.client

## Class DataFlowTemplate

- java.lang.Object
- - org.springframework.cloud.dataflow.rest.client.DataFlowTemplate

- All Implemented Interfaces:
    DataFlowOperations

      public class DataFlowTemplate
      extends Object
      implements DataFlowOperations

  Implementation of DataFlowOperations delegating to sub-templates, discovered via REST relations.
  Author:
    Ilayaperumal Gopinathan, Mark Fisher, Glenn Renfro, Patrick Peralta, Gary Russell, Eric Bottard, Gunnar Hillert

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected Map<String,org.springframework.hateoas.UriTemplate>` | `resources` Holds discovered URLs of the API.
    `protected org.springframework.web.client.RestTemplate` | `restTemplate` A template used for http interaction.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataFlowTemplate(URI baseURI)` Setup a `DataFlowTemplate` using the provided baseURI.
    `DataFlowTemplate(URI baseURI, org.springframework.web.client.RestTemplate restTemplate)` Setup a `DataFlowTemplate` using the provide `RestTemplate`.

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `AboutOperations` | `aboutOperation()`
    `AppRegistryOperations` | `appRegistryOperations()`
    `CompletionOperations` | `completionOperations()`
    `static org.springframework.web.client.RestTemplate` | `getDefaultDataflowRestTemplate()` Invokes `prepareRestTemplate(RestTemplate)`.
    `org.springframework.hateoas.Link` | `getLink(org.springframework.hateoas.RepresentationModel<?> resourceSupport, String rel)`
    `org.springframework.web.client.RestTemplate` | `getRestTemplate()`
    `JobOperations` | `jobOperations()`
    `static com.fasterxml.jackson.databind.ObjectMapper` | `prepareObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)` Mutable operation to add several required MixIns to the provided `ObjectMapper`.
    `static org.springframework.web.client.RestTemplate` | `prepareRestTemplate(org.springframework.web.client.RestTemplate restTemplate)` Will augment the provided `RestTemplate` with the Jackson Mixins required by Spring Cloud Data Flow, specifically: `JobExecutionJacksonMixIn` `JobParametersJacksonMixIn` `JobParameterJacksonMixIn` `JobInstanceJacksonMixIn` `ExitStatusJacksonMixIn` `StepExecutionJacksonMixIn` `ExecutionContextJacksonMixIn` `StepExecutionHistoryJacksonMixIn` Furthermore, this method will also register the `Jackson2HalModule`
    `RuntimeOperations` | `runtimeOperations()`
    `SchedulerOperations` | `schedulerOperations()`
    `StreamOperations` | `streamOperations()`
    `TaskOperations` | `taskOperations()`

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

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

- - ### Field Detail

    - #### restTemplate

          protected final org.springframework.web.client.RestTemplate restTemplate

      A template used for http interaction.

    - #### resources

          protected final Map<String,org.springframework.hateoas.UriTemplate> resources

      Holds discovered URLs of the API.

  - ### Constructor Detail

    - #### DataFlowTemplate

          public DataFlowTemplate(URI baseURI)

      Setup a `DataFlowTemplate` using the provided baseURI. Will build a `RestTemplate` implicitly with the required set of Jackson MixIns. For more information, please see `prepareRestTemplate(RestTemplate)`. Please be aware that the created RestTemplate will use the JDK's default timeout values. Consider passing in a custom `RestTemplate` or, depending on your JDK implementation, set System properties such as:
      - sun.net.client.defaultConnectTimeout
      - sun.net.client.defaultReadTimeout
      For more information see this link
      Parameters:
        `baseURI` - Must not be null

    - #### DataFlowTemplate

          public DataFlowTemplate(URI baseURI,
                                  org.springframework.web.client.RestTemplate restTemplate)

      Setup a `DataFlowTemplate` using the provide `RestTemplate`. Any missing Mixins for Jackson will be added implicitly. For more information, please see `prepareRestTemplate(RestTemplate)`.
      Parameters:
        `baseURI` - Must not be null
        `restTemplate` - Must not be null

  - ### Method Detail

    - #### prepareRestTemplate

          public static org.springframework.web.client.RestTemplate prepareRestTemplate(org.springframework.web.client.RestTemplate restTemplate)

      Will augment the provided `RestTemplate` with the Jackson Mixins required by Spring Cloud Data Flow, specifically:
      - `JobExecutionJacksonMixIn`
      - `JobParametersJacksonMixIn`
      - `JobParameterJacksonMixIn`
      - `JobInstanceJacksonMixIn`
      - `ExitStatusJacksonMixIn`
      - `StepExecutionJacksonMixIn`
      - `ExecutionContextJacksonMixIn`
      - `StepExecutionHistoryJacksonMixIn`
      Furthermore, this method will also register the `Jackson2HalModule`
      Parameters:
        `restTemplate` - Can be null. Instantiates a new `RestTemplate` if null
      Returns:
        RestTemplate with the required Jackson Mixins

    - #### prepareObjectMapper

          public static com.fasterxml.jackson.databind.ObjectMapper prepareObjectMapper(com.fasterxml.jackson.databind.ObjectMapper objectMapper)

      Mutable operation to add several required MixIns to the provided `ObjectMapper`.
      Parameters:
        `objectMapper` - Must not be null
      Returns:
        ObjectMapper with several mixIns applied

    - #### getDefaultDataflowRestTemplate

          public static org.springframework.web.client.RestTemplate getDefaultDataflowRestTemplate()

      Invokes `prepareRestTemplate(RestTemplate)`.
      Returns:
        RestTemplate with the required Jackson MixIns applied

    - #### getLink

          public org.springframework.hateoas.Link getLink(org.springframework.hateoas.RepresentationModel<?> resourceSupport,
                                                          String rel)

    - #### streamOperations

          public StreamOperations streamOperations()

      Specified by:
        `streamOperations` in interface `DataFlowOperations`
      Returns:
        Stream related operations.

    - #### taskOperations

          public TaskOperations taskOperations()

      Specified by:
        `taskOperations` in interface `DataFlowOperations`
      Returns:
        Task related operations.

    - #### jobOperations

          public JobOperations jobOperations()

      Specified by:
        `jobOperations` in interface `DataFlowOperations`
      Returns:
        Job related operations.

    - #### appRegistryOperations

          public AppRegistryOperations appRegistryOperations()

      Specified by:
        `appRegistryOperations` in interface `DataFlowOperations`
      Returns:
        Application registry related operations.

    - #### completionOperations

          public CompletionOperations completionOperations()

      Specified by:
        `completionOperations` in interface `DataFlowOperations`
      Returns:
        DSL Completion related operations.

    - #### runtimeOperations

          public RuntimeOperations runtimeOperations()

      Specified by:
        `runtimeOperations` in interface `DataFlowOperations`
      Returns:
        Runtime related operations.

    - #### aboutOperation

          public AboutOperations aboutOperation()

      Specified by:
        `aboutOperation` in interface `DataFlowOperations`
      Returns:
        "About" related operations.

    - #### schedulerOperations

          public SchedulerOperations schedulerOperations()

      Specified by:
        `schedulerOperations` in interface `DataFlowOperations`
      Returns:
        Scheduler related operations.

    - #### getRestTemplate

          public org.springframework.web.client.RestTemplate getRestTemplate()

      Returns:
        The underlying RestTemplate, will never return null

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.