Class DataFlowTemplate
java.lang.Object
org.springframework.cloud.dataflow.rest.client.DataFlowTemplate
- All Implemented Interfaces:
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
Modifier and TypeFieldDescriptionHolds discovered URLs of the API.protected final RestTemplate
A template used for http interaction. -
Constructor Summary
ConstructorDescriptionDataFlowTemplate
(URI baseURI, com.fasterxml.jackson.databind.ObjectMapper mapper) Setup aDataFlowTemplate
using the provided baseURI.DataFlowTemplate
(URI baseURI, RestTemplate restTemplate, com.fasterxml.jackson.databind.ObjectMapper mapper) Setup aDataFlowTemplate
using the provideRestTemplate
. -
Method Summary
Modifier and TypeMethodDescriptionstatic RestTemplate
InvokesprepareRestTemplate(RestTemplate)
.org.springframework.hateoas.Link
static com.fasterxml.jackson.databind.ObjectMapper
prepareObjectMapper
(com.fasterxml.jackson.databind.ObjectMapper objectMapper) Mutable operation to add several required MixIns to the providedObjectMapper
.static RestTemplate
prepareRestTemplate
(RestTemplate restTemplate) Will augment the providedRestTemplate
with the Jackson Mixins required by Spring Cloud Data Flow, specifically:JobExecutionJacksonMixIn
JobParametersJacksonMixIn
JobParameterJacksonMixIn
JobInstanceJacksonMixIn
ExitStatusJacksonMixIn
StepExecutionJacksonMixIn
ExecutionContextJacksonMixIn
StepExecutionHistoryJacksonMixIn
-
Field Details
-
restTemplate
A template used for http interaction. -
resources
Holds discovered URLs of the API.
-
-
Constructor Details
-
DataFlowTemplate
Setup aDataFlowTemplate
using the provided baseURI. Will build aRestTemplate
implicitly with the required set of Jackson MixIns. For more information, please seeprepareRestTemplate(RestTemplate)
. Please be aware that the created RestTemplate will use the JDK's default timeout values. Consider passing in a customRestTemplate
or, depending on your JDK implementation, set System properties such as:- sun.net.client.defaultConnectTimeout
- sun.net.client.defaultReadTimeout
- Parameters:
baseURI
- Must not be null
-
DataFlowTemplate
public DataFlowTemplate(URI baseURI, RestTemplate restTemplate, com.fasterxml.jackson.databind.ObjectMapper mapper) Setup aDataFlowTemplate
using the provideRestTemplate
. Any missing Mixins for Jackson will be added implicitly. For more information, please seeprepareRestTemplate(RestTemplate)
.- Parameters:
baseURI
- Must not be nullrestTemplate
- Must not be null
-
-
Method Details
-
prepareRestTemplate
Will augment the providedRestTemplate
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 newRestTemplate
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 providedObjectMapper
.- Parameters:
objectMapper
- Must not be null- Returns:
- ObjectMapper with several mixIns applied
-
getDefaultDataflowRestTemplate
InvokesprepareRestTemplate(RestTemplate)
.- Returns:
- RestTemplate with the required Jackson MixIns applied
-
getLink
public org.springframework.hateoas.Link getLink(org.springframework.hateoas.RepresentationModel<?> resourceSupport, String rel) -
streamOperations
- Specified by:
streamOperations
in interfaceDataFlowOperations
- Returns:
- Stream related operations.
-
taskOperations
- Specified by:
taskOperations
in interfaceDataFlowOperations
- Returns:
- Task related operations.
-
jobOperations
- Specified by:
jobOperations
in interfaceDataFlowOperations
- Returns:
- Job related operations.
-
appRegistryOperations
- Specified by:
appRegistryOperations
in interfaceDataFlowOperations
- Returns:
- Application registry related operations.
-
completionOperations
- Specified by:
completionOperations
in interfaceDataFlowOperations
- Returns:
- DSL Completion related operations.
-
runtimeOperations
- Specified by:
runtimeOperations
in interfaceDataFlowOperations
- Returns:
- Runtime related operations.
-
aboutOperation
- Specified by:
aboutOperation
in interfaceDataFlowOperations
- Returns:
- "About" related operations.
-
schedulerOperations
- Specified by:
schedulerOperations
in interfaceDataFlowOperations
- Returns:
- Scheduler related operations.
-
getRestTemplate
- Returns:
- The underlying RestTemplate, will never return null
-